[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - forward and getRequestUri question

richwin618 do-not-reply at jboss.com
Tue Mar 13 16:56:17 EDT 2007


I have a jsp act as a servlet like:

 <servlet-name>myJspServlet</servlet-name>
 <jsp-file>/myJspServlet.jsp</jsp-file>

<servlet-mapping>
 <servlet-name>MainLayout</servlet-name>
 <url-pattern>*.my</url-pattern>
</servlet-mapping>

mean all of request with .my should be processed by the servlet witch represented by myJspServlet.jsp

on the myJspServlet.jsp, I output the result of pageContext.getRequestUri()

I did some exprement, but the result are diffrent.

on JBoss 3.2.3 which based on tomcat4.1,
if I request page /abc/a.my, I got /abc/a.my (I call it result A)
if I request page/abc/f.jsp,  witch do pageContext.forward("/abc/a.my"); I got /myJspServlet.jsp (I call it result B)

further, if I change 
<jsp-file>/myJspServlet.jsp</jsp-file> 
to
<servlet-class>org.apache.jsp.myJspServlet_jsp</servlet-class>

I always get result B no matter the request was sent directly or by forward.

on tomcat 5.0. I always get result B no matter the request was sent directly or by forward , even I use <jsp-file> in web.xml

what's result is correct. is it just a bug in old tomcat. what does specification say(I red, but not clear to me). 

Thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027695#4027695

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027695



More information about the jboss-user mailing list