throws IOException, ServletException {
String path = RequestUtil.getPath(request);
if (request.getCharacterEncoding() == null) {
request.setCharacterEncoding(charset);
}
Router router = RouterFactory.getRouter();
if (request.getAttribute(ControllerConstants.ROUTED_KEY) == Boolean.TRUE) {
request.removeAttribute(ControllerConstants.ROUTED_KEY);
doFilter(request, response, chain, path);
} else {
if (!router.isStatic(path)) {
String routingPath = router.route(request, path);
if (routingPath != null) {
request.setAttribute(ControllerConstants.ROUTED_KEY, true);
doForward(request, response, routingPath);
} else {
doFilter(request, response, chain, path);