|
From: Brian Z. <bri...@ya...> - 2001-02-09 20:53:36
|
I'm using tomcat-3.2.1 on winNT/2k and linux.
Testing dispatch.SimpleIncludeServlet under
tomcat_home/webapps/WEB-INF/classes/
http://localhost:8080/test/servlet/dispatch.SimpleIncludeServlet
works perfectly fine, which returns
LINE1
TARGET1
LINE2
TARGET1
LINE3
in a text file.
But when I translated it into jython servlet using:
# SimpleInclude.py
import javax
class SimpleInclude(javax.servlet.http.HttpServlet):
def doGet(self, request, response):
response.setContentType("text/plain")
writer = response.getWriter()
writer.println("LINE1")
self.context = self.getServletConfig().getServletContext()
s = "/Target1.py"
rd = self.context.getRequestDispatcher(s)
rd.include(request, response)
writer.println("LINE2")
rd.include(request, response)
writer.println("LINE3")
# Target1.py
import javax
class Target1(javax.servlet.http.HttpServlet):
def doGet(self, request, response):
response.setContentType("text/plain")
writer = response.getWriter()
writer.println("TARGET1")
All I got is a browser full of LINE1, and then tomcat died.
As a matter of fact, if I just want to rd.include a static page, it
works fine.
I think it must somehow get into a recursive and got stack overflown.
Just want to see if anyone has an idea what is going on.
Thanks,
/Brian
|