Search in sources :

Example 1 with JspResourceManager

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();
}
Also used : JspResourceManager(org.noear.solon.boot.undertow.jsp.JspResourceManager) UtHandlerJspHandler(org.noear.solon.boot.undertow.http.UtHandlerJspHandler) TagLibraryInfo(org.apache.jasper.deploy.TagLibraryInfo) HackInstanceManager(io.undertow.jsp.HackInstanceManager) JspPropertyGroup(org.apache.jasper.deploy.JspPropertyGroup)

Aggregations

HackInstanceManager (io.undertow.jsp.HackInstanceManager)1 JspPropertyGroup (org.apache.jasper.deploy.JspPropertyGroup)1 TagLibraryInfo (org.apache.jasper.deploy.TagLibraryInfo)1 UtHandlerJspHandler (org.noear.solon.boot.undertow.http.UtHandlerJspHandler)1 JspResourceManager (org.noear.solon.boot.undertow.jsp.JspResourceManager)1