on 1/10/00 2:19 PM, Alan Boldock <[EMAIL PROTECTED]> wrote:
> I have been doing a redirect to another servlet like this
>
> res.sendRedirect("/blah/AnotherServlet");
>
> but for some reason this is slow (especially with IE5) so I tried
> doing this
>
> AnotherServlet as = new AnotherServlet();
> as.doGet(req,res);
>
> this is much quicker! but is it legal? I don't want to set up chaining as I
> only need it for this one place.
>
> I know its not strictly how one should do this but I can't see a good
> reason why I shouldn't.
>
>
> Alan Boldock
The above is *close* to what you want to do. Yes, it is perfectly legal. The
only issue is that you are getting yourself into a situation where you are
becoming a servlet engine yourself. There is more to a servlet than a
doGet() method. You have things like the init() and destory() methods to
also worry about. It is better to define your own interface and then call
the methods in that interface instead.
I suggest that you take a look at the methodology behind Turbine. It is a
well thought out solution to what you are doing. We are kind of billing it
as the servlet version of a MFC in that we have a methodology of doing
things like what you want to do as well as things like Global cache objects,
object persistence layer (for jdbc), a connection pool, parameter parsing,
and much much more..
<http://java.apache.org/turbine/>
thanks,
-jon
--
Come to the first official Apache Software Foundation
Conference! <http://ApacheCon.Com/>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]