2013年9月22日星期日

struts2 in the jsp from form submission fails, do not enter the action

 This post last edited by the ProgrammingPower on 2013-09-22 13:02:17
from head follows


I submit that the browser does not enter the struts2 action but in the browser address bar displays a line that
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 is that my path from where the JSP
followed I submit two properties courseid username but how one click Submit without entering the action but feel like GET submitted
went directly to the top of the browser it ? seeking god

code below
<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 file as follows

<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>

------ Solution ------------------------------------- -------
namespace MyApply
------ Solution ------------------------- -------------------
I remember that access should be action name attribute's value ! Do not know the name of the method did not remember !
------ Solution ---------------------------------------- ----
your form action = "/ MyApply / startFlow.action" into an absolute path action = "http://localhost:8080/MyApply/startFlow.action" try
- ---- Solution -------------------------------------------- < br> the / MyApply / startFlow.action written startFlow.action on the line you structs profile Id is not startFlow?
------ Solution ---------------------------------------- ----
your nameapace to /, remove the MyApply try
------ Solution ---------- ----------------------------------

  
not work, just found , I deliberately wrote a pass Woo 's action in the form is submitted not even 404 and above is still the same ,   
  
why these things   
  
instructions from the action did not even play a role.   
  
solving  


Maybe you wrong configuration file it , and had never encountered such a situation
------ Solution ------------------ --------------------------
your action class how to write ?
------ For reference only -------------------------------------- -
I did not use wildcards to write given path

just do not know how it happened

other action are valid

on this not work !

seeking god , thank you !
------ For reference only ---------------------------- -----------
not have , a variety of entrance, a good egg pain !!!
------ For reference only --------- ------------------------------
  The reply deleted by an administrator at 2013-09-22 15:53:00

------ For reference only ---------------------------------- -----


not work, just found , I deliberately wrote a pass Woo 's action in the form is submitted not even 404 and above is still the same ,

why these things

instructions from the action did not even play a role.

solving
------ For reference only --------------------------------- ------
problem solved, it was my jsp page , there is a place to write a closing tag did not empty from label
led me to the following from an abnormality of the label .

coding seems to be more careful ah !

没有评论:

发表评论