Re: Serving a website based on source internet address
- From: "Babu Kalakrishnan" <bkk.ngroup@xxxxxxxxx>
- Date: 29 Aug 2006 10:13:50 -0700
Skybuck wrote:
Hello,
Based on the source internet address a different version of the website
should be presented/served to the user/browser.
For example in pseudo code:
if SourceAddress = '143.3.5.1' then
begin
ShowBlueWebsite; // Load/Show BlueIndex.htm
end else
if SourceAddress = '124.5.15.7' then
begin
ShowRedWebsite; // LoadShow RedIndex.htm
end;
Is this possible with java ? is there any source code available to do
this trick ?
Try the request.getRemoteHost() and/or the request.getRemoteAddr()
methods and send an appropriate redirect to the client based on the
values returned.
Make sure you test the application with whatever target servlet
engine(s) that ou plan to deploy your application on, as well as
different browsers / with and without proxies. In my experience, the
outputs returned by some of the methods of HttpServletRequest give you
surprises with certain combinations of UserAgent/Proxy/Servlet engine.
BK
.
- Follow-Ups:
- Re: Serving a website based on source internet address
- From: Tom Cole
- Re: Serving a website based on source internet address
- References:
- Serving a website based on source internet address
- From: Skybuck
- Serving a website based on source internet address
- Prev by Date: Re: java.util.Random.nextInt() thread safety
- Next by Date: Re: Running java programs from class files
- Previous by thread: Serving a website based on source internet address
- Next by thread: Re: Serving a website based on source internet address
- Index(es):
Relevant Pages
|