Charlie,
That's the answer I came up with as well (i.e. using 
request.getContext()). Never got a satisfactory answer from any 
Macromediites on the JRun forum. This is the second apparent bug 
I've encountered in converting a Tomcat app to JRun My sense is 
that JRun more loosely interprets the servlet specs than Tomcat.

Dave



At 10:06 PM 8/2/02 -0400, you wrote:
>This is a pain, but, you can do it using HttpServletRequest
>getContextPath() to always ensure the corrent context path is there. i.e.:
>
>response.sendRedirect(request.getContext()+"/web/" + nextPage);
>
>Now, the shameless plug. Keep an eye on http://www.jspbook.com. Kevin
>Jones and I have been working hard to put out a good, bleeding-edge book
>on JSP 2.0 and Servlets 2.4(it will be out soon but after the specs are
>final of course ;). This issue gets a direct mention :)
>
>Cheers,
>
>Jayson Falkner
>[EMAIL PROTECTED]
>
>charlie arehart wrote:
> > Dave, did you ever find an answer to this?  I'd be curious about it myself
> >
> > /charlie
> >
> > PS Can't do any testing to offer answers due a recent crash 
> I'm in the midst
> > of recovering from.
> >
> >
> >>-----Original Message-----
> >>From: Dave Jones [mailto:[EMAIL PROTECTED]]
> >>Sent: Wednesday, July 24, 2002 3:02 PM
> >>To: JRun-Talk
> >>Subject: sendRedirect + relative path = bug?
> >>
> >>
> >>In another in the series of travails in converting an app from
> >>Tomcat to JRun, I've run into what seems to be a bug in JRun's
> >>implementation of sendRedirect.
> >>
> >>For example, the following statement:
> >>
> >>response.sendRedirect("../web/" + nextPage);
> >>
> >>throws the error:
> >>
> >>404 Not found
> >>http://hostname/servlet/../web/Dispatch.jsp?page=ProspectMaint.jsp
> >>&reset=true
> >>
> >>This works fine in Tomcat, but it seems pretty clear JRun is not
> >>resolving the relative path.
> >>
> >>Changing the statement to use an absolute path (e.g. "/web/")
> >>works, but since the absolute path resolves to the server root
> >>rather than context root, I prefer to use relative addressing so
> >>that I can easily move the app between development, staging and
> >>production environments.
> >>
> >>Is this a bug or are things done differently in the JRun world?
> >>
> >>TIA,
> >>Dave Jones
> >>NetEffect
> >>
> >>
> >
> >
>
______________________________________________________________________
Get the JRun Web Application Construction Kit - the only book written specifically for 
JRun developers.
http://www.amazon.com/exec/obidos/ASIN/0789726009/houseoffusion
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to