tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10405] New: - ClassCastException is thrown when request.setAttribute("charset", non_string) is called before request.getParameter() call.
Date Tue, 02 Jul 2002 13:51:59 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10405>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10405

ClassCastException is thrown when request.setAttribute("charset", non_string) is called before
request.getParameter() call.

           Summary: ClassCastException is thrown when
                    request.setAttribute("charset", non_string) is called
                    before request.getParameter() call.
           Product: Tomcat 3
           Version: 3.3.1 Final
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Servlet
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: toyokazu.tomatsu@sun.com


Here is a simple Servlet that reproduce the problem.
-----------------------------------------------
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class Attr extends HttpServlet {
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
	request.setAttribute("charset", new Object());
	request.getParameter("blah");
    }
}

--------------------------------------------
java.lang.ClassCastException: java.lang.Object
	at
org.apache.tomcat.modules.mappers.DecodeInterceptor.getInfo(DecodeInterceptor.java:581)
	at org.apache.tomcat.core.Request.getCharEncoding(Request.java:483)
	at org.apache.tomcat.core.Request.getCharacterEncoding(Request.java:470)
	at org.apache.tomcat.core.Request.handleQueryParameters(Request.java:451)
	at
org.apache.tomcat.facade.HttpServletRequestFacade.getParameter(HttpServletRequestFacade.java:277)
	at Attr.doGet(Attr.java:12)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java)
	at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
	at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
	at org.apache.tomcat.core.Handler.service(Handler.java:235)
	at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
	at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
	at
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
	at java.lang.Thread.run(Thread.java:536)

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message