This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 12759
    
    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/
 
jQuery in Action, 2nd edition
 
subject: Original Servlet Name after a Forward to a jsp
 
Similar Threads
getting the value from <bean:write> tag
Different INPUT.jsp in DispatchAction
installing multiple instance of tomcat
mysql & incomplete insertions!
call a servlet from a jsp????