The following examples assume that your context root is
"/webapp/examples"
Example 1:
When requesting the following:
http://localhost/webapp/examples/subdir/hello.jsp
Hello.jsp does a sendRedirect()as shown below (this is
a relative sendRedirect that begins with a "/"):
response.sendRedirect ("/me.jsp");
- For WebSphere Application Server V5.0 (all releases)
By default, in all releases of V5.0, this results in your client
being redirected to the following URL:
http://localhost/me.jsp
However, if your Java™ Virtual Machine (JVM) system property
com.ibm.websphere.sendredirect.compatibility is set to
true, this will result in your client being redirected to the
following URL:
http://localhost/webapp/examples/me.jsp
- For WebSphere Application Server V4.0 (all releases)
By default, in all releases of V4.0, this results in the client being
redirected to the following URL:
http://localhost/webapp/examples/me.jsp
However, if your JVM system property
com.ibm.websphere.sendredirect.compliance is set to true,
this will result in your client being redirected to the following URL:
http://localhost/me.jsp
Example 2:
When requesting the following:
http://localhost/webapp/examples/subdir/hello.jsp
Hello.jsp does a sendRedirect() as shown below (this is
a relative sendRedirect that does not begin with a "/"):
response.sendRedirect ("me.jsp")
All releases of WebSphere Application Server V4.0 and V5.0 will make this
relative to the current URL and redirect the client to the following URL
(notice that "subdir" is included in the redirected URL):
http://localhost/webapp/examples/subdir/me.jsp
|