You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marco Baringer <ma...@convey.it> on 2001/05/25 19:36:55 UTC

RequestDispatcher.include(String)/RequestDispatcher.forward(String)

Let's say I have a site where I map every URL to the same servlet,
there's something like this in my web.xml

<servlet-mapping>
  <servlet-name>bob</servlet-name>
  <url-pattern>*</url-pattern>
</servlet-mapping>

This precludes me from having anything else on my site, which is ok
with me, almost. My servlets usually do their work and then use a
forward or an include to get a jsp page to view the results, however
in this case whatever jsp i try to include i get the servlet, the
servlet starts trying to include itself and it takes about 4 seconds
to a stack overflow in the JVM. Even if I have a jsp in the context
tomcat always calls the servlet. this is being done because i have a
site with one and only servlet which takes one and only parameter and
so i've decided to use the name i call the servlet with (the URI) as
the parameter. This solution is simple and I wuite like it, but I
can't show the results short of the servlet use
Request.getWriter().print(...) which is something I'd rather avoid.

Question: 
1) Can I include a resource which is on the file system and bypass
tomcat's parsing of the resource (i want /t.jsp and not to call the
servlet as /t.jsp)?

2) if not can i exclude some urls from the url-pattern?

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There's a crack in everything.
It's how the light gets in.
	-Isonard Cohen