You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Purcell <sp...@vertisinc.com> on 2005/03/04 21:55:42 UTC

Does not call action?

Hello,
I have this in my struts-config.xml file
 
 <action
    path="/manageAssets"
    type="com.skp.action.LoginAction"
    forward="/jsp/admin/manageAssets.jsp" redirect="true" />
 
 
When I call the container with "/action/manageAssets" it just forwards to the jsp page and does not use the type? I put a bunch of println statements in com.skp.action.LoginAction but it is not called? Could I be missing something?
 
Thanks,

Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | spurcell@vertisinc.com | http://www.vertisinc.com <http://www.vertisinc.com/>  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
                                                 

 

Re: Does not call action?

Posted by Hubert Rabago <hr...@gmail.com>.
You probably meant to do something this:

  <action
     path="/manageAssets"
     type="com.skp.action.LoginAction">
     <forward name="success" path="/jsp/admin/manageAssets.jsp"
redirect="true" />
  </action>

   ... where LoginAction would return mapping.findForward("success");

The way you wrote it told Struts that for requests that match
"/manageAssets", it should automatically redirect the request to the
"/jsp/admin/manageAssets.jsp"

Hubert


On Fri, 4 Mar 2005 14:55:42 -0600, Scott Purcell <sp...@vertisinc.com> wrote:
> Hello,
> I have this in my struts-config.xml file
> 
>  <action
>     path="/manageAssets"
>     type="com.skp.action.LoginAction"
>     forward="/jsp/admin/manageAssets.jsp" redirect="true" />
> 
> When I call the container with "/action/manageAssets" it just forwards to the jsp page and does not use the type? I put a bunch of println statements in com.skp.action.LoginAction but it is not called? Could I be missing something?
> 
> Thanks,
> 
> Scott K Purcell | Developer | VERTIS |
> 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
> 314.588.0720 Ext:1320 | spurcell@vertisinc.com | http://www.vertisinc.com <http://www.vertisinc.com/>
> 
> Vertis is the premier provider of targeted advertising, media, and
> marketing services that drive consumers to marketers more effectively.
> 
>

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


Re: Does not call action?

Posted by Joe Germuska <Jo...@Germuska.com>.
At 2:55 PM -0600 3/4/05, Scott Purcell wrote:
>Hello,
>I have this in my struts-config.xml file
>
>  <action
>     path="/manageAssets"
>     type="com.skp.action.LoginAction"
>     forward="/jsp/admin/manageAssets.jsp" redirect="true" />
>
>
>When I call the container with "/action/manageAssets" it just 
>forwards to the jsp page and does not use the type? I put a bunch of 
>println statements in com.skp.action.LoginAction but it is not 
>called? Could I be missing something?

using "forward" in an action element "trumps" the "type".

If your intention is to execute the action and then go to the 
forward, use this:

  <action
     path="/manageAssets"
     type="com.skp.action.LoginAction">
     <forward name="default" path="/jsp/admin/manageAssets.jsp" 
redirect="true" />
   </action>

and then in your action, finish with
return mapping.findForward("default");

In Struts 1.3 (not yet released), it is possible to use commons-chain 
to define a command which is executed "on the way" to handling a 
forward, which may be more the model you had in mind when you wrote 
that configuration.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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