关于Struts2.0 将jsp页面值传递到.java文件的问题

来源:百度知道 编辑:UC知道 时间:2024/06/05 11:57:33
Jsp01.jsp:
<form action="searchOrder.action" method="post">
<input name="orderID" type="text"><br>
<button type="submit">Submit</button>
</form>

struts.xml:
<action name="searchOrder" class="view.OrderSearch">
<result name="input">/Jsp01.jsp</result>
<result>/Jsp02.jsp</result>
</action>

public class OrderSearch extends ActionSupport{
private Order order = new Order();
public String execute() throws Exception {
OrderControl orderControl = new OrderControl();
String orderID = null;
orderID = this.order.getOrderID();.....................

我的order为什么不能得到.jsp传来的orderID值???调试显示为null
一楼的是Struts1.1的,不要来忽悠我,Struts1.x的版本我了解一些的

struts.config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>

<action-mappings>

<action path="/WorkresAction" type="com.spk.yzoa.workres.action.WorkresAction" name="" scope="request" input="">
<forward name="find" path="/oa/workres/WorkresList.jsp" />
</action>

</action-mappings>

</struts-config>

jsp传值直接这样写。
String orderID = null;
orderID = request.getParameter("orderID");

看下我的action.
if (mode.equalsIgnore