日期:2014-05-18  浏览次数:20655 次

struts2 在jsp的from表单提交失效,不进入action
本帖最后由 ProgrammingPower 于 2013-09-22 13:02:17 编辑
from头如下

<form action="/MyApply/startFlow.action" method="post">
我一点提交 浏览器不进入struts2的action 而是在浏览器地址栏显示一行这个
http://localhost:8080/MyApply/itheima/customer/process/startFlow.jsp?courseId=1&username=%E6%9B%B9%E5%AE%87

http://localhost:8080/MyApply/itheima/customer/process/startFlow.jsp是我这个from所在JSP的路径
后面是我提交的两个属性 courseid username  可是怎么一点击提交 不进入action   反而感觉跟GET提交了
直接跑到了浏览器上面了呢? 求大神

代码如下
<form action="/MyApply/startFlow.action" method="post">
    
     <table>
     <tr>
<td width="130px" align="right" height="45px">请选择您的意向课程:</td>
<td>

   <input type="radio" name="courseId" value="1" onBlur="checkCourse()">高数&nbsp;&nbsp;&nbsp;

   <input type="radio" name="courseId" value="3" onBlur="checkCourse()">数据结构&nbsp;&nbsp;&nbsp;

   <input type="radio" name="courseId" value="4" onBlur="checkCourse()">运筹学&nbsp;&nbsp;&nbsp;
<input type="hidden" name="username" value="${sessionScope.user.username}" /> 
   <span id="s1" style="color: red;padding-left: 10px;"></span>
</td>
</tr>
<tr>
<td colspan="2" height="80px;">
<div style="background:url('../../images/customer/pic_button01.gif') no-repeat left top;width:110px; height:42px; padding-left:10px;">
<input type="submit" value="提交" style="outline:0 none; border:0 none; background:url('../../images/customer/pic_button01.gif') no-repeat right top;width:120px; height:42px;font-size:20px;color:#FFF;font-weight: bold;cursor:hand" />
    </div>
</td>
</tr>
</table>
</form>



struts.xml文件内容如下

<package name="jbpm" namespace="/" extends="struts-default">
    <action name="startFlow" class="com.my.apply.action.FlowAction" method="startFlow">
    <result>/my/customer/process/applyIndex.jsp</result>
    <result name="repeat">/repeat.jsp</result>
    </action>