mirror of
https://gitee.com/nutz/nutzboot.git
synced 2024-12-02 03:38:08 +08:00
change: 修改一下代码
This commit is contained in:
parent
803b4fcbd1
commit
5b060c3636
@ -18,6 +18,7 @@ import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.server.handler.ErrorHandler;
|
||||
import org.eclipse.jetty.servlet.ErrorPageErrorHandler;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
@ -194,14 +195,12 @@ public class JettyStarter extends AbstractServletContainerStarter implements Ser
|
||||
wac.getServletContext().setExtendedListenerTypes(true);
|
||||
wac.getSessionHandler().setMaxInactiveInterval(getSessionTimeout());
|
||||
|
||||
List<ErrorPageErrorHandler> errorHandlers = appContext.getBeans(ErrorPageErrorHandler.class);
|
||||
ErrorPageErrorHandler ep;
|
||||
if(errorHandlers.size() > 0){
|
||||
ep = errorHandlers.get(0);
|
||||
}else{
|
||||
ep = new ErrorPageErrorHandler();
|
||||
ErrorHandler ep = Lang.first(appContext.getBeans(ErrorHandler.class));
|
||||
if(ep == null){
|
||||
ErrorPageErrorHandler handler = new ErrorPageErrorHandler();
|
||||
handler.setErrorPages(getErrorPages());
|
||||
ep = handler;
|
||||
}
|
||||
ep.setErrorPages(getErrorPages());
|
||||
wac.setErrorHandler(ep);
|
||||
|
||||
// 设置一下额外的东西
|
||||
|
Loading…
Reference in New Issue
Block a user