If I want my JSP pages to work in a situation where cookies are disabled and
the server is doing URL rewriting
do I have to use EncodeURL for all of my HREF (and perhaps IMG) tags in my
JSP page.
Example. Here is a JSP page that retrieves an image (stored in a database)
via a servlet and has hyperlinks
to other JSP pages. Note: I am using a servlet mapping to map a servlet to a
directory
The way you would expect to write this page is something like this.
<IMG SRC="mediaservlet?mediaId=5000"><BR>
<a href="page1.jsp">page1</a><BR>
<a href="page2.jsp">page2</a><BR>
<a href="page3.jsp">page3</a><BR>
If I want the page to work in a URL-rewriting mode do I have to do the
following?
<IMG SRC="<%= response.encodeURL("mediaservlet?mediaId=5000")%>"><BR>
<a href="<%=response.encodeURL("page1.jsp")%>">page1</a><BR>
<a href="<%=response.encodeURL("page2.jsp")%>">page2</a><BR>
<a href="<%=response.encodeURL("page3.jsp")%>">page3</a><BR>
What I'm basically looking for is some guidance on whether or not I need to
do option 2 all of the time to
maximize portability and survive cookie-disabled browsers.
If option 2 is what I should do, why doesn't JSP shield the HTML developer
from this? The goal would be for
the JSP author to be a higher-end HTML developer who shouldn't have to worry
about maintaining the
session, etc.
Thanks
Dave Bolt
ATSC/SPAWAR ASAT Team
Bolt's Law of Bandwidth - There is always plenty of network bandwidth, just
none for you.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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