Hi!

To obtain some URI manipulation I implemented an instance of javax.servlet.http.HttpServletRequest.


public class MultiLingueHSR implements HttpServletRequest {
    HttpServletRequest httpServletRequest=null;

    public MultiLingueHSR(HttpServletRequest httpServletRequest) {
        this.httpServletRequest = httpServletRequest;
        // custom code...
    }


    public String getRequestURI() {

        return // return custom values ;
    }

    //all the other methos are implemented like these...

    public Object getAttribute(String arg0) {
        return httpServletRequest.getAttribute(arg0);
    }

    public String getAuthType() {
        return httpServletRequest.getAuthType();
    }

    public String getCharacterEncoding() {
        return httpServletRequest.getCharacterEncoding();
    }

    public int getContentLength() {
        return httpServletRequest.getContentLength();
    }

    public String getContentType() {
        return httpServletRequest.getContentType();
    }

    public String getContextPath() {
        return httpServletRequest.getContextPath();
    }

    ...
}


Then I used this in a filter in the following way

public void doFilter(ServletRequest request, ServletResponse response,
                       FilterChain nextFilter)
         throws ServletException, IOException
   {

        MultiLingueHSR mlHSR=new MultiLingueHSR(req);
mlHSR.getRequestDispatcher(mlHSR.getRequestURI()).include(mlHSR,response);
   }

This code worked fine in resin 3.0 and 3.1 but on resin 4.0.7 I get this exception

java.lang.ClassCastException: it.sodomaco.turcom.lingue.MultiLingueHSR cannot 
be cast to com.caucho.server.http.CauchoRequest
it.sodomaco.turcom.lingue.MultiLingueHSR cannot be cast to 
com.caucho.server.http.CauchoRequest
com.caucho.server.http.CauchoRequestWrapper.getCauchoRequest(CauchoRequestWrapper.java:790)
com.caucho.server.http.CauchoRequestWrapper.getSessionId(CauchoRequestWrapper.java:476)
com.caucho.server.http.AbstractCauchoRequest.finishRequest(AbstractCauchoRequest.java:588)
com.caucho.server.webapp.IncludeRequest.finishRequest(IncludeRequest.java:365)
com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:342)
it.sodomaco.turcom.MainFilter.doFilter(MainFilter.java:107)

....

Any ideas or suggestions?
Is this beaviour to be considered a bug of resin?

thank you in advance

Andrea


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to