In your example you're changing the host name in the URL (not the path). This 
really can only be done using a "redirect" (technically an HTTP response code 
303 or 301) since the client is essentially talking to a different host. In 
your LoginAction class you'll want a method that looks like this:

public Resolution login() {
return       new 
RedirectResolution("https://subdomain1.mydomain.com/userHome.action";); 
}

"re-writing", made famous by the apache mod_rewrite, has the ability to do 
"Forwards" which are processed within the HTTP server without negotiation with 
the browser and "Redirects" which are processed by the browser. Forwards 
(available in Stripes using ForwardResolution) are particularly good at 
directing a request to a JSP presentation components.

Using a RedirectResolution on a successful login is a best practice. It makes 
the application behave more predictably if the user reloads the 
"UserHome.action" page after submitting the login. Generally speaking, it's 
always good to follow a "POST" request with a redirect.

Much of the behavior of mod_rewrite can be emulated by Java Servlet filters and 
operates independently of Stripes.
http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/Filter.html

Stripes has lots of great utilities for managing redirects and forwards. Look 
at the implementation of the Resolution interface for the details.

On Jan 21, 2011, at 8:19 PM, Joaquin Valdez rote:

> Seems to me that would be more a function of the webserver than the app.  Am 
> I wrong?
> 
> 
> On Jan 21, 2011, at 8:01 PM, Yee wrote:
> 
>> To be more specific- what I need to do is not redirecting to another 'place',
>> but to rewrite the url.
>> 
>> So the request could be: https://www.mydomain.com/login.action
>> 
>> After the user login I need to rewrite the url to become:
>> https://subdomain1.mydomain.com/userHome.action,
>> https://subdomain2.mydomain.com/userHome.action etc.
>> 
>> The url looks different, but it is the same action bean at the server.
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
>> Finally, a world-class log management solution at an even better price-free!
>> Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
>> February 28th, so secure your free ArcSight Logger TODAY! 
>> http://p.sf.net/sfu/arcsight-sfd2d
>> _______________________________________________
>> Stripes-users mailing list
>> Stripes-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
> 
> Joaquin Valdez
> joaquinfval...@gmail.com
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
> February 28th, so secure your free ArcSight Logger TODAY! 
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to