Issue Type: Bug Bug
Affects Versions: JRuby 1.6.7
Assignee: Unassigned
Components: Rails WAR Deployment
Created: 26/Jun/12 5:22 PM
Description:

When a java servlet filter is installed and runs before the request gets to the jruby-rack adapter, it can call request.getParameters. If the request is a post with x-www-form-urlencoded as the MIME type, the servlet container will parse the post body and put any parameters it finds there into a string map. This has the side effect of consuming the stream that contains the post body. When jruby-rack comes along and tries to call getInputStream, there is no data to get, and no post parameters visible in the controller action.

This is the same basic problem as JRUBY-2497 which occurs in tomcat v5 and v6.

I worked around the problem by adding this code as a before filter for all of my controllers:

def handle_java_parameters
   request.env['java.servlet_request'].andand.getParameterNames.andand.each do |parameter|
     Rack::Utils::normalize_params(params, parameter, request.env['java.servlet_request'].getParameter(parameter))
   end
 end


    
Project: JRuby
Priority: Minor Minor
Reporter: Nathan Walker
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to