History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1278
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rainer Hermanns
Reporter: tm_jee
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WebWork

Prefix failed when Multipart form is submited

Created: 28/Mar/06 09:42 AM   Updated: 18/Jun/06 04:52 AM
Component/s: None
Affects Version/s: 2.2.2
Fix Version/s: 2.2.3

File Attachments: 1. Text File WW-1278.patch (2 kb)



 Description  « Hide
Prefix failed when Multipart form is submited

see http://forums.opensymphony.com/thread.jspa?threadID=23756&tstart=0

 All   Comments   Change History      Sort Order:
tm_jee - [28/Mar/06 09:46 AM ]
FilterDispatcher needs to wrap up mutipart request earlier before ActionMapper is give a chance to getMapping(...)

In FilterDispatcher ...

public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
     .....
     ServletContext servletContext = filterConfig.getServletContext();
        try {
            request = du.wrapRequest(request, servletContext);
        } catch (IOException e) {
            String message = "Could not wrap servlet request with MultipartRequestWrapper!";
            LOG.error(message, e);
            throw new ServletException(message, e);
        }
        ActionMapper mapper = ActionMapperFactory.getMapper();
        ActionMapping mapping = mapper.getMapping(request);
        .....
         du.serviceAction(request, response, servletContext, mapping);
        ....
}


instead of current

public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
     .....
     ServletContext servletContext = filterConfig.getServletContext();
        
ActionMapper mapper = ActionMapperFactory.getMapper();
        ActionMapping mapping = mapper.getMapping(request);
        .....
        ....
        try {
            request = du.wrapRequest(request, servletContext);
        } catch (IOException e) {
            String message = "Could not wrap servlet request with MultipartRequestWrapper!";
            LOG.error(message, e);
            throw new ServletException(message, e);
        }
         du.serviceAction(request, response, servletContext, mapping);
        ....
}

tm_jee - [28/Mar/06 09:48 AM ]
Can someone review it and if its ok, patched it into SAF2.0 once the code in Apache inbator stabilized. Thx. :-)

Benx Shen - [28/Mar/06 10:14 AM ]
I create a new class extending FilterDispatcher and override doFilter() method as above. It seems to work well.

Rainer Hermanns - [28/Mar/06 11:31 AM ]
Toby,
yes will do later this week...
Thanks

Rainer Hermanns - [18/Jun/06 04:52 AM ]
Fixed in CVS