You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Carl Walker <wa...@georgetown.edu> on 2003/01/13 18:19:52 UTC

IE 6.0 and Missing Request Param. [CODE LISTING]

I don't know if this will help anyone.  I was having a problem with a
form submission using IE 6.  When I posted a form loaded by HTTP to JSP
under Apache 1.3/mod_jk/Tomcat 4.1.12 (I tried 4.1.18 too) using HTTPS,
IE sent a Content-type of 'application/x-www-form-urlencoded,
application/x-www-form-urlencoded' instead of just
'application/x-www-form-urlencoded'.  As a result, the body of the HTTP
request couldn't be parsed so none of the parameters in the <input
type="hidden"> tags were accessible by the JSP.  Note that if I back up
and resubmit, everything works (that's after a JSESSIONID cookie is
set).

This bug can be verified by loading the RequestDumperValve or increasing

the LogLevel with mod_jk..

Has anyone else had a similar problem?  Is this really an IE bug or is
there a problem with my Apache/JK/Tomcat configuration?

My workaround was to register this Valve with my <Host> element.

--- ContentTypeFixerValve.java follows
package edu.georgetown.tomcat;

import java.io.IOException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletException;
import org.apache.catalina.Request;
import org.apache.catalina.Response;
import org.apache.catalina.Valve;
import org.apache.catalina.ValveContext;

public class ContentTypeFixerValve implements Valve
{
    public String getInfo() {
        return "edu.georgetown.tomcat.ContentTypeFixerValve";
    }

    public void invoke(Request request, Response response, ValveContext
context)
        throws IOException, ServletException
    {
        ServletRequest s_request = request.getRequest();

        String ct = s_request.getContentType();

        if(ct.equals("application/x-www-form-urlencoded,
application/x-www-form-urlencoded")) {
            request.setContentType("application/x-www-form-urlencoded");

        }

        context.invokeNext(request, response);
    }
}





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>