JSP Configuration In Wildfly 8 Final
esharapov Mar 11, 2014 4:11 PMIn my application I have bunch of files (stylesheets and javascripts) that have to be processed by the Jasper. On Tomcat and JBoss we have following in web.xml
<servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>/scripts/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>/stylesheets/*</url-pattern> </servlet-mapping>
When deployed on the Wildfly, application doesn't work, as these files are not going through the JSP processor. In the standalone.xml I have:
<subsystem xmlns="urn:jboss:domain:undertow:1.0"> <buffer-caches> <buffer-cache name="default" buffer-size="1024" buffers-per-region="1024" max-regions="10"/> </buffer-caches> <server name="default-server"> <http-listener name="default" socket-binding="http"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> <servlet-container name="default" default-buffer-cache="default" stack-trace-on-error="local-only"> <jsp-config/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/> </handlers> <filters> <response-header name="server-header" header-name="Server" header-value="Wildfly 8"/> <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow 1"/> </filters> </subsystem>
Is there way to configure JSP servlet somehow in standalone.xml ? I noticed in wildfly\undertow\src\main\java\org\wildfly\extension\undertow\JSPConfig.java
final io.undertow.servlet.api.ServletInfo jspServlet = new ServletInfo("Default JSP Servlet", JspServlet.class) .addMapping("*.jsp") .addMapping("*.jspx");
I have tried to add .jsp to my stylesheets and JavaScripts and it worked. Can I add some other extensions like *.css or *.js to the default JspServlet mappings. Could it be done in the server configuration. My application should work across various platforms and it works on Tomcat 6 and 7 and JBoss up to 6.1. The only stumbling block is Wildfly. I couldn't find much documentation and XSD for the undertow subsystem is of no help.