does not contain handler parameter named 'method' 异常

在处理convert.jsp时报错:
javax.servlet.ServletException: Request [/transconvert] does not contain handler parameter named 'action '.
org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:215)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:249)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
convert.jsp的源码如下:
 
< %@ taglib uri ="/WEB-INF/struts-bean.tld" prefix ="bean"% >
< %@ taglib uri ="/WEB-INF/struts-html.tld" prefix ="html"% >
< %@ taglib uri ="/WEB-INF/struts-logic.tld" prefix ="logic"% >
< bean:define id ="TransConvertForm" name ="TransConvertForm" type ="com.webex.webapp.l10n.struts.action.xport.ConvertTranslationActionForm" />
< html >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=ISO-8859-1" >
< title >Online Convert </title>
....
< script type ="text/javascript" >
      function ConvertWebexTags(){
        /* Valifycation ignore now*/
        
        document.forms[1].method.value="convert";
        
        document.forms[1].submit();
        alert(location.href);
      }
     </script>
</head>
< body >
    
   < jsp:include flush ="true" page ="../translation/mapLink.jsp" > </jsp:include>
     < table border ="0" cellpadding ="0" cellspacing ="0" width ="100%" >
       < tbody >
         < tr >
           < td style ="text-align: right;" >
             < input type ="button" value ="Go Back" onclick ="searchTrans()" >  
           </td>
         </tr>
       </tbody>
     </table>
     < table width ="100%" border ="0" >
         < TR class ="TblTitleBgColor" >
           < TD colspan=3 class ="TblTitleFont" >
            Convert WebexTags to Project Dictionary
           </TD>
         </TR>

         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          Please click the < b >Select File </b> button to select < B >XML/Strings (*.xml, *.strings) </B> file(s) from your computer.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 >  </TD>
         </TR>
        <!--    
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
           < B >Submission requirements: </B>
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          File Creator: Microsoft Excel(97-2007).
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          File Type: Excel/CSV.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TbContentFont2" >
          File Format:*.xls,*.xlsx *.csv.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          File Content: First line is title which can't be changed.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 > < font SIZE ="1" Color ="#0000cc" >
          Example:TagName English  CHINESEGB || CHINESEBIG5 || SPANISH TagEndMark
           </font>
           </TD>
         </TR>
         -->
         < TR >
           < TD colspan=3 >  </TD>
         </TR>
       </table>
     < hr />
    
     < html:form action ="transconvert" method ="post" >
       < html:hidden property ="taskId" />
       < html:hidden property ="actionType" />
       < html:hidden property ="projectId" />
       < html:hidden property ="moduleId" />
     </html:form>
     < input type ="button" value ="cancel" id ="btnCancel" style ="visibility: hidden;" />
     < BR >
     < table border ="0" cellpadding ="0" cellspacing ="0" >
       < html:form action ="transconvert" method ="post" >
       < tr >
         < td >
            
           < b >Module: </b> 
         </td>
         < td >
            
           < html:hidden property ="projectType" />
           < input id ="uid" type ="hidden" name ="uid" value='<bean:write name ="uid" />'/>
           < html:select property ="moduleType" >
             < html:options collection ="moduleList" property ="value" labelProperty ="label" />
           </html:select>
         </td>
       </tr>
       < tr >
         < td >
           < b >File Type: </b> 
         </td>
         < td >
            
           < html:select property ="fileType" >
             < html:options collection ="fileTypeList" property ="value" labelProperty ="label" />
           </html:select> 
            
        ……
</body>
</html>
解决方法,是在将要提交的form中添加语句<input type="hidden" name="method" value="" />如下所示:
< %@ taglib uri ="/WEB-INF/struts-bean.tld" prefix ="bean"% >
< %@ taglib uri ="/WEB-INF/struts-html.tld" prefix ="html"% >
< %@ taglib uri ="/WEB-INF/struts-logic.tld" prefix ="logic"% >
< bean:define id ="TransConvertForm" name ="TransConvertForm" type ="com.webex.webapp.l10n.struts.action.xport.ConvertTranslationActionForm" />
< html >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=ISO-8859-1" >
< title >Online Convert </title>
……
< script type ="text/javascript" >
      function ConvertWebexTags(){
        /* Valifycation ignore now*/
        
        document.forms[1].method.value="convert";
        
        document.forms[1].submit();
        alert(location.href);
      }
     </script>
</head>
< body >
    
   < jsp:include flush ="true" page ="../translation/mapLink.jsp" > </jsp:include>
     < table border ="0" cellpadding ="0" cellspacing ="0" width ="100%" >
       < tbody >
         < tr >
           < td style ="text-align: right;" >
             < input type ="button" value ="Go Back" onclick ="searchTrans()" >  
           </td>
         </tr>
       </tbody>
     </table>
     < table width ="100%" border ="0" >
         < TR class ="TblTitleBgColor" >
           < TD colspan=3 class ="TblTitleFont" >
            Convert WebexTags to Project Dictionary
           </TD>
         </TR>

         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          Please click the < b >Select File </b> button to select < B >XML/Strings (*.xml, *.strings) </B> file(s) from your computer.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 >  </TD>
         </TR>
        <!--    
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
           < B >Submission requirements: </B>
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          File Creator: Microsoft Excel(97-2007).
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          File Type: Excel/CSV.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TbContentFont2" >
          File Format:*.xls,*.xlsx *.csv.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 class ="TblContentFont2" >
          File Content: First line is title which can't be changed.
           </TD>
         </TR>
        
         < TR >
           < TD colspan=3 > < font SIZE ="1" Color ="#0000cc" >
          Example:TagName English  CHINESEGB || CHINESEBIG5 || SPANISH TagEndMark
           </font>
           </TD>
         </TR>
         -->
         < TR >
           < TD colspan=3 >  </TD>
         </TR>
       </table>
     < hr />
    
     < html:form action ="transconvert" method ="post" >
       < html:hidden property ="taskId" />
       < html:hidden property ="actionType" />
       < html:hidden property ="projectId" />
       < html:hidden property ="moduleId" />
     </html:form>
     < input type ="button" value ="cancel" id ="btnCancel" style ="visibility: hidden;" />
     < BR >
     < table border ="0" cellpadding ="0" cellspacing ="0" >
       < html:form action ="transconvert" method ="post" >
       < tr >
         < td >
            
           < b >Module: </b> 
         </td>
         < td >
           <input type="hidden" name="method" value="" />
           < html:hidden property ="projectType" />
           < input id ="uid" type ="hidden" name ="uid" value='<bean:write name ="uid" />'/>
           < html:select property ="moduleType" >
             < html:options collection ="moduleList" property ="value" labelProperty ="label" />
           </html:select> 
        ……
</body>
</html>

你可能感兴趣的:(parameter,职场,异常,handler,contain,休闲,not,named,does,'method')