You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pantichd <pa...@firstenergycorp.com> on 2006/07/19 21:15:03 UTC

Can Action class send user to url not in struts-config.xml?

Hello,

Is there a way for an action class to send a user to a url other than those
defined as forwards in the struts-config.xml file?

My situation is this:
A filter checks every request in the system to verify that the user has
logged in. If not, the user is sent to the login.jsp page.

The login.jsp executes a login action class that has a forward for a
successful and unsuccessful login. 

The action class is a generic class that can be used by different apps. I
want to customize it so that an app can specify that a user should be sent
to the original url requested upon a successful login.

I don't know how to accomplish that if I don't have the url specified as a
forward in the struts-config.xml.

Thanks in advance for any help.

David.
-- 
View this message in context: http://www.nabble.com/Can-Action-class-send-user-to-url-not-in-struts-config.xml--tf1968310.html#a5402595
Sent from the Struts - User forum at Nabble.com.


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


Re: Can Action class send user to url not in struts-config.xml?

Posted by pantichd <pa...@firstenergycorp.com>.
Thanks Adam!



Adam Hardy-3 wrote:
> 
> String forwardUrl = "/private/payments.do?" + customQueryString;
> forward = new ActionForward("anyName", forwardUrl, false); 
> 
> 
> But I would recommend against going down that route, or at least try to
> keep it really simple. 
> 
> 
-- 
View this message in context: http://www.nabble.com/Can-Action-class-send-user-to-url-not-in-struts-config.xml--tf1968310.html#a5405946
Sent from the Struts - User forum at Nabble.com.


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


Re: Can Action class send user to url not in struts-config.xml?

Posted by pantichd <pa...@firstenergycorp.com>.
After doing some more research ran into some posts about ActionRedirect. 

Would this be a better fit for what I'm trying to do?

Thanks!
-- 
View this message in context: http://www.nabble.com/Can-Action-class-send-user-to-url-not-in-struts-config.xml--tf1968310.html#a5438442
Sent from the Struts - User forum at Nabble.com.


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


Re: Can Action class send user to url not in struts-config.xml?

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
pantichd on 19/07/06 20:15, wrote:
> Is there a way for an action class to send a user to a url other than those
> defined as forwards in the struts-config.xml file?
> 
> My situation is this:
> A filter checks every request in the system to verify that the user has
> logged in. If not, the user is sent to the login.jsp page.
> 
> The login.jsp executes a login action class that has a forward for a
> successful and unsuccessful login. 
> 
> The action class is a generic class that can be used by different apps. I
> want to customize it so that an app can specify that a user should be sent
> to the original url requested upon a successful login.

String forwardUrl = "/private/payments.do?" + customQueryString;
forward = new ActionForward("anyName", forwardUrl, false); 


But I would recommend against going down that route, or at least try to keep it really simple. 

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