This seems like a good solution!

Does it work with tomcat 3.1?

I tried a test case and got something, but I'm not sure what...

I requested a jsp file in my testcase context, my servlet was hit as
expected (it spit out it's stderr message), and the following page was
returned : 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252"
http-equiv=Content-Type></HEAD>
<BODY><XMP></XMP></BODY></HTML>

Does this mean that jserv-servlet didn't find anything to process?  I think
so, because I get the same thing if I hit a non-existent jsp page in the
same context.

Here's what I have in my servlet's doGet : 

        
getServletConfig().getServletContext().getNamedDispatcher("jserv-servlet").f
orward(request,response);

Thanks...

...Casey

==============================================
Casey Bragg - Software Engineer
Allegiance Telecom, Inc.  Dallas, TX
214-261-8679 - [EMAIL PROTECTED]
==============================================


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 04, 2000 11:35 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: MVC problem


I guess, there IS a way to forward the .jsp processing to tomcat's
jsp-servlet, even when you have registered your own servlet to process all
.jps requests.

Instead of using
    ServletContext.getRequestDispatcher(url).forward(request, response);
use

ServletContext.getNamedRequestDispatcher("jserv-servlet").forward(request,
response);

It worked for me.

Note: This method does not work if you want to "re-write" the url in your
handler servlet. JSP files processed by the jserv-servlet is always the URL
of the original request.

Kedar

Reply via email to