> Hello,
>
[quoted text clipped - 15 lines]
> 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
Tom Cole - 29 Aug 2006 19:34 GMT
1. This was cross-posted in comp.lang.javascript where an answer was
posted.
2. When you say "done in java" I assume that you have a website that is
written in JSP/J2EE? From your other post it did not seem so...If so
then you don't even need to do this, you can setup hosts in your
servlet container which will handle this for you.