strange error that happens every second or third time the form is
submitted. Otherwise it works? I was orignially using 1.1 struts but just
upgraded with the same issue to 1.2.4. I thinking it's a timing or threading
issue, because of the way it works then doesn't work. The error message was a
little better after going to struts 1.2.4. It suggested "This may be caused
by whitespace in the label text". Although this would be strange considering
that it works then doesn't work on the next submit. The other weird thing
with this issue is that it seemed to work fine until I added a second
DynaActionForm and a second method that is mapped in the same way as
addcomponent action.



Here's the DynaActionForm in struts-config :

<form-bean name="addComponentForm"
      type="org.apache.struts.action.DynaActionForm">
      <form-property name="componentName" type="java.lang.String"
initial="" />
      <form-property name="product" type="java.lang.String" />
    </form-bean>

Here's the addcomponent action :

       <action path="/addcomponent"
             name="addComponentForm"
             scope="session"
             type="com.ihs.accumap.action.AdminFunctionsAction"
             validate="true"
            parameter="method"
            input="/addComponent.jsp">
     <forward name="addedcomponent" path="/addedcomponent.jsp"/>
     <forward name="failedtoaddcomponent" path="/addcomponent.jsp"/>
     <forward name="failure" path="/error.jsp"/>
   </action>

Here's most of the jsp :

<html:form action="/addcomponent">
<html:hidden name="testListForm" property="product"/> <!-- we need the product
name for this component as well -->


<table VALIGN="top" cellpadding="3" cellspacing="1" WIDTH="%80"
bgcolor="ffffcc" align=center>
<tr>
 <td>Enter new component name : </td> <td><html:text size="25"
name="addComponentForm" property="componentName"/></td>
</tr>
 <td>
 <table align="right" bgcolor="ffffcc">
     <td align="right" >
         <html:submit property="method">
           <bean:message key="function.addcomponent"/>
         </html:submit>
         <html:reset/>
     </td>
   </tr>
 </table>
   </td>
 </tr>
</table>
</html:form>
<br/>
<table>
        <tr>
        <td><html:errors/></td>
        </tr>
        <tr>
        <td><html:messages id="mess"/></td>
        </tr>
</table>
</body>
</html:html>

Here's the important bits out of my Action class:

public class AdminFunctionsAction extends LookupDispatchAction
{

   protected Map getKeyMethodMap() {
     Map map = new HashMap();
     map.put("function.addtestcase", "addTestCase");
     map.put("function.addproduct", "addProduct");
     map.put("function.addcomponent", "addComponent");
     map.put("function.deletecomponent", "removeComponent" );
     return map;
   }



   public ActionForward addComponent( ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
     // do add

     DynaActionForm addCompForm = (DynaActionForm) form;

     try{
       HttpSession session = request.getSession();
       UserAccountsView user = this.getUser( session );


if( user.getUserName().length() < 1 ) return (mapping.findForward("needtoauthenticate"));

       ComponentService compService = this.getComponentService( session );

if ( compService.addComponent( addCompForm.get("componentName" ) + "",
addCompForm.get("product") + "", user ) )
return mapping.findForward("addedcomponent" );
else return mapping.findForward("failedtoaddcomponent");
} catch( Exception x ){
x.printStackTrace();
System.out.println("Blew up trying to add component....");
return mapping.findForward("failedtoaddcomponent");
}finally{
addCompForm.set("componentName", "" );
}
}




Here's the error:

javax.servlet.ServletException: Request[/addcomponent] does not contain
handler parameter named 'method'.  This may be caused by whitespace in the
label text.
        at org.apache.struts.actions.DispatchAction.unspecified
(DispatchAction.java:224)
        at org.apache.struts.actions.DispatchAction.dispatchMethod
(DispatchAction.java:258)
        at org.apache.struts.actions.LookupDispatchAction.execute
(LookupDispatchAction.java:162)
        at org.apache.struts.action.RequestProcessor.processActionPerform
(RequestProcessor.java:421)
        at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:226)
        at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1164)
        at org.apache.struts.action.ActionServlet.doPost
(ActionServlet.java:415)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:200)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:146)
        at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:209)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNe
xt(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:948)
        at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:144)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNe
xt(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:948)
        at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2358)
        at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:133)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNe
xt(StandardPipeline.java:596)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:118)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNe
xt(StandardPipeline.java:594)
        at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:116)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNe
xt(StandardPipeline.java:594)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:948)
        at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:127)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNe
xt(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:948)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:152)
        at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:799)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnecti
on(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:683)
        at java.lang.Thread.run(Unknown Source)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to