File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Original Servlet Name after a Forward to a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Original Servlet Name after a Forward to a jsp" Watch "Original Servlet Name after a Forward to a jsp" New topic
Author

Original Servlet Name after a Forward to a jsp

sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
Hi,
I am sure there is an answer to this one but i have not been able to find out.
I have a servlet registered as xxx from which i forward to some jsp page /yyy/zzz.jsp
How can i get the original xxx Servlet name in the zzz.jsp
I have tried the Referer in the header, the request URI, the Servlet name in the request and the Path Info. None of these have worked as all return /yyy/zzz.jsp
Any Help will be greatly appreciated
TIA
S


Adios
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
Maybe you should attach the servlet name to the request with setAttribute before forwarding so the JSP can get it later.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
it shouldn't matter which servlet they came from the jsps point of view. Jsp shouldn't handle conditional logic, or if it does, it should be limited to just presentation as much as possible.
Having said that, you could use request.getRequestURL() (see the javadoc for HttpServletRequest).


comp.lang.javascript FAQ: http://jibbering.com/faq/
 
 
subject: Original Servlet Name after a Forward to a jsp