Kevin Duffey wrote:
>
> Thanks Craig. That did inform me more than I had hoped! ;)
>
> When you get time...do you use getServletPath() or getRequestURI() to get
> your action from a form action=""?
As I stated in my example, I use getServletPath() and strip off the extension.
> In either case, what is the difference?
See the servlet spec for details, but the basic idea is this:
request URI = context path + servlet path + path info
>
> Lastly, is there a way to ALWAYS get the actual page the from is on, so that
> I can forward back to that page? Right now I use getRequestURI() and it
> return the /uri.do pattern, instead of the file. It does return the full
> path information as to where the file is actually stored on the server, but
> it doesn't return the jsp file name itself.
>
The request uri tells you where the form was sent to (your servlet). Where it came
from is stored in an HTTP header:
String requestingPage = request.getHeader("referer");
>
> Thanks.
>
Craig
===========================================================================
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