use of org.noear.solon.boot.undertow.jsp.JspResourceManager in project solon by noear.
the class PluginUndertowJsp method buildHandler.
@Override
protected HttpHandler buildHandler() throws Exception {
DeploymentInfo builder = initDeploymentInfo();
// 添加jsp处理
String fileRoot = getResourceRoot();
builder.setResourceManager(new JspResourceManager(JarClassLoader.global(), fileRoot)).addServlet(new ServletInfo("ACTServlet", UtHandlerJspHandler.class).addMapping("/")).addServlet(JspServletEx.createServlet("JSPServlet", "*.jsp"));
// 添加taglib支持
HashMap<String, TagLibraryInfo> tagLibraryMap = JspTldLocator.createTldInfos("WEB-INF");
JspServletBuilder.setupDeployment(builder, new HashMap<String, JspPropertyGroup>(), tagLibraryMap, new HackInstanceManager());
// 开始部署
final ServletContainer container = ServletContainer.Factory.newInstance();
DeploymentManager manager = container.addDeployment(builder);
manager.deploy();
return manager.start();
}
Aggregations