You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/05/07 07:05:33 UTC

DO NOT REPLY [Bug 42343] New: - Posted parameters are not available

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: tomcat-dev@jakarta.apache.org
        ReportedBy: tedman@sfu.ca


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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 42343] - Posted parameters are not available

Posted by bu...@apache.org.
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


remm@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




------- Additional Comments From remm@apache.org  2007-05-07 01:15 -------
Tomcat will do a redirect in this situation, this is why it does not work. This
issue will not be fixed.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 42343] - Posted parameters are not available

Posted by bu...@apache.org.
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





------- Additional Comments From tedman@sfu.ca  2007-07-24 07:43 -------
(In reply to comment #5)
> I'm having the same problem, but with a Servlet mapping. No servlet is able to
> obtain HTTP Post parameters from the HttpRequest object. Here's web.xml:

I don't have problems with servlets; however, I don't think I tried POST, I only
tried GET. I didn't think this problem affected servlets.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 42343] - Posted parameters are not available

Posted by bu...@apache.org.
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





------- Additional Comments From philippe.desrosiers@gmail.com  2007-07-24 07:00 -------
(In reply to comment #4)
I'm having the same problem, but with a Servlet mapping. No servlet is able to
obtain HTTP Post parameters from the HttpRequest object. Here's web.xml:

    <servlet>
        <servlet-name>mpp</servlet-name>
        <description>My Servlet</description>
        <servlet-class>
            org.whatever.MyServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

In Tomcat 5, posts to localhost/mpp would result in org.whatever.MyServlet
correctly able to get the request parameters. In Tomcat 6 this is no longer the
case. Is there some additional server settings I need to change in order to
re-enable this?

> (In reply to comment #3)
> > Interesting approach... What if the URL I am trying to filter doesn't correspond
> > to a file, directory, or even a servlet mapping?
> 
> it shouldn't be a problem in that case, it's only a problem because a reference
> to a directory / path with out a file also maps to the index pages, such as
> index.html index.jsp, (or what ever you have configured in your web.xml) and
> causes a redirect on the server side (but no a normal servlet redirect).



-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 42343] - Posted parameters are not available

Posted by bu...@apache.org.
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





------- Additional Comments From tedman@sfu.ca  2007-05-07 08:17 -------
Although I recognise the techical reason as to why it doesn't work and I can
also some what agree that the index.jsp may arguably not receive the posted
parameters, I have to put my 2 cent protest into the servlet filter which is
mapped to /*, not receiving the posted parameters.

I guess it's not too important since there's a work around via just putting the
actual filename in my case.

thanx.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 42343] - Posted parameters are not available

Posted by bu...@apache.org.
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





------- Additional Comments From roger.keays@ninthavenue.com.au  2007-05-29 20:56 -------
Interesting approach... What if the URL I am trying to filter doesn't correspond
to a file, directory, or even a servlet 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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 42343] - Posted parameters are not available

Posted by bu...@apache.org.
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





------- Additional Comments From tedman@sfu.ca  2007-05-30 06:34 -------
(In reply to comment #3)
> Interesting approach... What if the URL I am trying to filter doesn't correspond
> to a file, directory, or even a servlet mapping?

it shouldn't be a problem in that case, it's only a problem because a reference
to a directory / path with out a file also maps to the index pages, such as
index.html index.jsp, (or what ever you have configured in your web.xml) and
causes a redirect on the server side (but no a normal servlet redirect).

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org