tm_jee added a comment - 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 added a comment - 28/Mar/06 10:14 AM I create a new class extending FilterDispatcher and override doFilter() method as above. It seems to work well.
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);
....
}