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=42343>.
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=42343

           Summary: Posted parameters are not available
           Product: Tomcat 6
           Version: 6.0.10
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


when submitting a form post with parameters, if you post to a directory instead
of an exact file you don't receive the form post parameters.

As an example if you have a web page with

 <form method="post" action="/test" >
    parameter1 <input type="text" name="parameter1" /> <br />
    parameter2 <input type="text" name="parameter2" /> <br />
    parameter3 <input type="text" name="parameter3" /> <br />
    <input type="submit" />
 </form>

where /test is the contextPath or a directory

if you have a ServletFilter, the filter will not get the parameters, i.e. if I
have request.getParameter("parameter1"); it will return null. Also if I have an
index.jsp in the test directory (or contextRoot) and I do request.getParameter()
from the page, I also don't get the parameters.

If I change the form action to action="/test/index.jsp" both the filter and the
index.jsp will receive the post parameters as expected.

I should also note that I'm fairly sure this worked in tomcat 5.5.20 as I had
working code for that which now doesn't work in tomcat 6.0.10

Some additional information is as follows 
   Linux version 2.6.11-1.1369_FC4 (fedora core 4)
   java full version "1.6.0-b105"
   tomcat 6.0.10

The code I used for getting the parameters was 
        
        public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException
    {
                System.err.println("*** doFilter()");
                        
                Map parameters=request.getParameterMap();
                for (Object o : parameters.entrySet())
                {
                        Map.Entry entry=(Map.Entry)o;
                        System.err.println("Entry: 
"+entry.getKey()+'='+entry.getValue());
                }
                
            chain.doFilter(request, response);
    }
    
My web.xml was configured as follows 

        <filter>
                <filter-name>TestFilter</filter-name>
                <filter-class>TestFilter</filter-class>
        </filter>

        <filter-mapping>
                <filter-name>TestFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to