/* (Kein Javadoc)
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
WGARequestInformation info = new WGARequestInformation();
try {
info.setStartTime(System.currentTimeMillis());
request.setAttribute(WGARequestInformation.REQUEST_ATTRIBUTENAME, info);
_wgaFilterChain.init(request, chain);
_currentRequests.put(request, info);
// F000037B2
if (_core.getCharacterEncoding() != null) {
request.setCharacterEncoding(_core.getCharacterEncoding());
// B000041DA
response.setCharacterEncoding(_core.getCharacterEncoding());
}
HttpServletResponse wrappedResponse = new FinalCharacterEncodingResponseWrapper((HttpServletResponse)response);
if (((HttpServletRequest)request).getMethod().equalsIgnoreCase("GET")) {
HttpServletRequest wrappedRequest = new GETRequestWrapper((HttpServletRequest)request, _core.getCharacterEncoding());
_wgaFilterChain.doFilter(wrappedRequest, wrappedResponse);
} else {
_wgaFilterChain.doFilter(request, wrappedResponse);
}
info.setStatusCode(((FinalCharacterEncodingResponseWrapper)wrappedResponse).getStatusCode());
info.setStatusMessage(((FinalCharacterEncodingResponseWrapper)wrappedResponse).getStatusMessage());
}
catch (ServletException e) {
info.setStatusCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
info.setStatusMessage(e.getMessage());
throw e;
}
finally {
info.setEndTime(System.currentTimeMillis());
try {
WGALoggerWrapper logger = _core.getAccessLogger();
if (logger != null) {
logger.logRequest(request);
}