----- Original Message -----
From: Oliver Burn <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 10, 1999 9:47 AM
Subject: RequestDispatcher semantics (JRun bug?)


> I am currently doing an evaluation of JRun 2.3 (build 152) for use on our
> project. Our architecture requires the use of the
> javax.servlet.RequestDispatcher.forward() method. I have been prototyping
using
> the forward() method with JRun and have come across the problem that I
cannot
> forward a request back to the same Servlet (with different parameters). I
am not
> sure if this is a bug with JRun or my misunderstanding of the Servlet 2.1
> specification. Reading the Servlet 2.1 API it states about the forward()
method:

>   You cannot use this method if a ServletOutputStream object or
PrintWriter
>   object has been obtained from the response. In that case, the method
throws an
>   IllegalStateException.
>
> It does not state that a request cannot be forwarded back to the same
Servlet.

Why forward to the same servlet? Doing that does not make sense.
Surely once a servlet is processing a request then it can modify that
requests state
to fit your requirements.

You can either redirect a client to where they need to go or chain servlets
together.


> However JRun is throwing an exception stating that you cannot forward to
the
> same URI. My questions are:
> o Is this a JRun bug or am I completely hosed?
> o Does anybody have a work around?
> o Why would JRun want to have this restriction? It prevents (valid)
recursive
>   programs.

This isn't valid recursive programming, you are sending recursive requests
which is something
completely different. If you make a mistake and your servlet keeps sending
forwards to itself it will
die bringing the server down with it. Is that desirable behaviour?

I can't see it being a bug on the part of Livesoft, they seem to have built
this in deliberately.

Andy Bailey

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to