StaticFileView.init(serverConfig, getViewPath());
}
@Override
protected void addLastHandler(String uri, String servletURI, final HandlerChainImpl chain) {
WebHandler last = null;
if(servletURI != null)
last = resource.match(servletURI);
if(last != null) {
chain.add(last);
return;
}
final String path = uri.equals("/") ? "/index.html" : uri;
File file = new File(serverConfig.getServerHome(), path);
if (!file.exists() || file.isDirectory())
return;
chain.add(new WebHandler(){
@Override
public View invoke(HttpServletRequest request, HttpServletResponse response) {
return new StaticFileView(path);
}