You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ádamo Azambuja <ad...@gmail.com> on 2007/10/19 15:57:48 UTC

Struts + spring

I try to use Struts 1 with spring, my action run ok with execute() method,
but i like to use one diferent method to any  action like:
userList, userDelete, userUpdate etc....
To do this i use this confi on my struts config, but a error is show when i
try execute the action usuarioList.do.
        <action
            path="/usuarioList"
            name="usuarioForm"
            type="org.springframework.web.struts.DelegatingActionProxy"
            scope="request" parameter="method"
             >
                <forward name="sucesso" path="/UsuarioList.jsp" />
                <forward name="list" path="/UsuarioList.jsp"/>
                <forward name="edit" path="/UsuarioList.jsp"/>
        </action>


Error log
StandardWrapperValve[action]: Servlet.service() for servlet action threw
exception
javax.servlet.ServletException: Request[/usuarioList] 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:222)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(
DispatchAction.java:256)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java
:194)

-- 
Ádamo B. Azambuja
JEE Developer
icq: 112102893
msn: adamobas@hotmail.com
E-Mail 1: adamobas@yahoo.com.br
E-Mail 2: adamobas@gmail.com

Re: Struts + spring

Posted by Ádamo Azambuja <ad...@gmail.com>.
i use this: MappingDispatchActionSupport now i dont need to put the execute
method on my actions. When i call some like localhost/myAction.do they call
one method with name myAction inside my Action java file. :-)
God bless spring :-)

2007/10/19, Antonio Petrelli <an...@gmail.com>:
>
> 2007/10/19, Ádamo Azambuja <ad...@gmail.com>:
> > ok, i forget to put method on the url, but i really need to put they
> there?
> > they cant take my action name and use this like the method param?
>
> If you don't need it, don't use DispatchAction! Use a simple action.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Ádamo B. Azambuja
JEE Developer
icq: 112102893
msn: adamobas@hotmail.com
E-Mail 1: adamobas@yahoo.com.br
E-Mail 2: adamobas@gmail.com

Re: Struts + spring

Posted by Antonio Petrelli <an...@gmail.com>.
2007/10/19, Ádamo Azambuja <ad...@gmail.com>:
> ok, i forget to put method on the url, but i really need to put they there?
> they cant take my action name and use this like the method param?

If you don't need it, don't use DispatchAction! Use a simple action.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts + spring

Posted by Ádamo Azambuja <ad...@gmail.com>.
Now i put the Spring to control my actions and they dont work with my method
property, some one know what is happening?
now i use type="org.spring....
struts-config:
        <action
            path="/usuarioList"
            name="usuarioForm"
            type="org.springframework.web.struts.DelegatingActionProxy"
            scope="request" parameter="method"
             >
                <forward name="sucesso" path="/UsuarioList.jsp" />
                <forward name="list" path="/UsuarioList.jsp"/>
                <forward name="edit" path="/UsuarioList.jsp"/>
        </action>




2007/10/19, Ádamo Azambuja <ad...@gmail.com>:
>
> ok, i forget to put method on the url, but i really need to put they
> there? they cant take my action name and use this like the method param?
>
> 2007/10/19, Antonio Petrelli < antonio.petrelli@gmail.com>:
> >
> > 2007/10/19, Ádamo Azambuja < adamobas@gmail.com>:
> > >
> > > Error log
> > > StandardWrapperValve[action]: Servlet.service() for servlet action
> > threw
> > > exception
> > > javax.servlet.ServletException: Request[/usuarioList] does not contain
> >
> > > handler parameter named 'method'.  This may be caused by whitespace in
> > the
> > > label text.
> >
> >
> >
> > You are not using DispatchAction correctly: you forgot to put the
> > "method"
> > parameter (or, possibly, you need a simple action :-) ). See:
> >
> > http://struts.apache.org/1.3.8/apidocs/org/apache/struts/actions/DispatchAction.html
> >
> > Antonio
> >
> > P.S. Spring has not anything to do with this problem.
> >
>
>
>
> --
> Ádamo B. Azambuja
> JEE Developer
> icq: 112102893
> msn: adamobas@hotmail.com
> E-Mail 1: adamobas@yahoo.com.br
> E-Mail 2: adamobas@gmail.com
>



-- 
Ádamo B. Azambuja
JEE Developer
icq: 112102893
msn: adamobas@hotmail.com
E-Mail 1: adamobas@yahoo.com.br
E-Mail 2: adamobas@gmail.com

Re: Struts + spring

Posted by Ádamo Azambuja <ad...@gmail.com>.
ok, i forget to put method on the url, but i really need to put they there?
they cant take my action name and use this like the method param?

2007/10/19, Antonio Petrelli <an...@gmail.com>:
>
> 2007/10/19, Ádamo Azambuja <ad...@gmail.com>:
> >
> > Error log
> > StandardWrapperValve[action]: Servlet.service() for servlet action threw
> > exception
> > javax.servlet.ServletException: Request[/usuarioList] does not contain
> > handler parameter named 'method'.  This may be caused by whitespace in
> the
> > label text.
>
>
>
> You are not using DispatchAction correctly: you forgot to put the "method"
> parameter (or, possibly, you need a simple action :-) ). See:
>
> http://struts.apache.org/1.3.8/apidocs/org/apache/struts/actions/DispatchAction.html
>
> Antonio
>
> P.S. Spring has not anything to do with this problem.
>



-- 
Ádamo B. Azambuja
JEE Developer
icq: 112102893
msn: adamobas@hotmail.com
E-Mail 1: adamobas@yahoo.com.br
E-Mail 2: adamobas@gmail.com

Re: Struts + spring

Posted by Antonio Petrelli <an...@gmail.com>.
2007/10/19, Ádamo Azambuja <ad...@gmail.com>:
>
> Error log
> StandardWrapperValve[action]: Servlet.service() for servlet action threw
> exception
> javax.servlet.ServletException: Request[/usuarioList] does not contain
> handler parameter named 'method'.  This may be caused by whitespace in the
> label text.



You are not using DispatchAction correctly: you forgot to put the "method"
parameter (or, possibly, you need a simple action :-) ). See:
http://struts.apache.org/1.3.8/apidocs/org/apache/struts/actions/DispatchAction.html

Antonio

P.S. Spring has not anything to do with this problem.