I think I already sent you the answer.  You have a "ControlServlet" servlet
which has a "BeanServlet" servlet do its work processing the request in the
ControlServlet's service(Req, Res) method.  The call to the BeanServlet
returns a RouterServlet.  The RouterServlet has the code I previously sent
you, which can send to Servlet, html, JSP, whatever.

Do you understand?  This is a fairly standard Model 2 architecture problem,
I think, even if you are obviously in WAP.

-----Original Message-----
From: Dr. Evil <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, October 26, 2001 2:10 AM
Subject: More experiments with changing the default (/) mapping


>
>I have figured out a few things about how servlet-mapping and
>RequestDispatcher might work together.
>
>If I put in a servlet-mapping entry for /* (which will catch every
>request coming in to the server, which is something which I need to
>do), and I make the servlet which handles it look like this:
>
>RequestDispatcher rd = context.getNamedDispatcher("default");
>rd.forward(request, response);
>
>then it works for serving plain old static files.  In toher words,
>http://localhost/foo/bar.html will get the bar.html from the /foo
>directory.
>
>This leaves me with two problems:  First, if I understand correctly,
>servlets are not allowed to modify the HttpRequest object.  This means
>that my director servlet can't change which director bar.html will be
>in.  This is bad for me.
>
>Second, I can't get it to work at all for jsp pages.  I would have
>thought that:
>
>RequestDispatcher rd = context.getNamedDispatcher("jsp");
>rd.forward(request, response);
>
>would work but it doesn't.  I get an exception with a message
>"org.apache.jasper.JasperException: No output directory: String index
>out of range: -1".  I can't figure out why that is happening or what
>to do about it.
>
>So, any sugestions on a) changing the paths "default" and "jsp" will
>use to get their source pages from and b) how to get jsp to work?
>
>I also thought about doing this with filters, but the problem with
>filters is that they can only dispatch to servlets, not to jsp or html
>pages, which is what I need to do.  Any sugestions would be most
>appreciated.
>
>Thanks
>

Reply via email to