struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: How do I get the Base URL from Struts?
Date Tue, 01 Nov 2005 23:05:03 GMT
Brian Demers wrote:
> Hey everyone,
> 
> This is a common problem with all of the web apps I have been working
> on.  I am looking for a clean way to solve this problem.  I am using
> an API that requires the base URL: "http://something:8080/myApp/"
> 
> The problem is if I go through a proxy this will change where the
> request came from.
> 
> How do I get the base URL from a struts action?
> 
> Thanks,
> -Brian Demers

This was just discussed on this list; check the archives for more 
details. But the simple answer is, use mapping.getPath() to get the URL 
as mapped in struts-config.xml; use request.getRequestURI() or 
request.getRequestURL() to get the actual URI used.

L.


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


Mime
View raw message