struts-config.xml中<form-bean>没有配吗?
<form-bean name="XXXForm" type="放你的form的路径">
</form-bean>
对应的Action为
<action name="XXXForm" path="/submit" scope="request" type="你的action的路径">
<forward name="success" path="成功后转到的页面"></forward>
</action>
Struts的包是要的啊,其它的就你的情况还不需要了。
在你下面这段代码中你的Test是没有得到值的,所以是打印不出来了
public class SelectAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
System.out.println("test"); return (mapping.findForward("success"));
}
}
<form-bean name="XXXForm" type="放你的form的路径">
</form-bean>
对应的Action为
<action name="XXXForm" path="/submit" scope="request" type="你的action的路径">
<forward name="success" path="成功后转到的页面"></forward>
</action>
Struts的包是要的啊,其它的就你的情况还不需要了。
在你下面这段代码中你的Test是没有得到值的,所以是打印不出来了
public class SelectAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
System.out.println("test"); return (mapping.findForward("success"));
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货