c2yh wrote:
>
> Hi,
>
> Can anybody show me how to do URL Rewriting?
>
> I want to forward processing to another page using <jsp:forward>,
> but this does not change the URL showing on browsers.
> How to modify the URL in Java/JSP?
URL Rewriting is a term used for embedding a session ID in a URL
to handle session tracking without cookies. It has nothing to do
with changing the URL shown in the address field of the browser.
The <jsp:forward> action tells the server to continue processing
a request using another JSP or servlet. It results in an internal
call to the new JSP/servlet on the server; the browser is not
aware of it at all and continues to show the original URL, and
there's no way to tell it to change it when you use forward.
In most cases, it doesn't matter what URL is shown in the browser.
In cases where this is important, though, you must use a redirect
instead of a forward to invoke the second page. A redirect means
that the first page sends a response to the browser telling it to
make a new request for the second page. The browser updates the
address shown in the address field and invokes the second page.
This is slower than a forward, since it requires a round-trip to
the browser and involves two requests instead of one.
For more about this, I recommend a JSP book, such as mine:
<http://TheJSPBook.com/>
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets