cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17594] - WebSphere redirect bug
Date Mon, 11 Oct 2004 09:06:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=17594>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=17594

WebSphere redirect bug





------- Additional Comments From federico.pastore@gmail.com  2004-10-11 09:06 -------
Hi everybody,
we are using cocoon 2.1.5.1 on websphere 5.1; the behaviour is similar.
we got a page [context]/foo/bar that perform a response.sendRedirect("test") and
the result is [context]/test; It seems like forget the servletPath. This bug is
declared on IBM forum at
http://www-106.ibm.com/developerworks/forums/dw_thread.jsp?forum=266&thread=34310&message=2808822&cat=9&q=redirect#2808822
 and it appears on WAS only if a servlet is configured as default servlet.
we have found a temporary solution by writing an implementation of
HttpServletResponse invoked through a servlet filter that replace the wrong
servletPath with the correct one
es:
    public void sendRedirect(String arg0) throws IOException {
        String fromURI = this.req.getRequestURI();
        if (!arg0.startsWith("http://") && !arg0.startsWith("/")) {
            String prefixURI = fromURI.substring(0, fromURI.lastIndexOf("/"));
            arg0 = prefixURI + "/" + arg0;
        }       
        res.sendRedirect(arg0);
    }

Mime
View raw message