Struts2 jar META-INF资源中的Servlet 3.0平铺定义

Struts2 jar META-INF资源中的Servlet 3.0平铺定义,struts2,jboss,jboss7.x,tiles,servlet-3.0,Struts2,Jboss,Jboss7.x,Tiles,Servlet 3.0,我正在使用新的Servlet3.0方法将web资源(如Javascript、CSS和JSP)打包到JAR文件中。该方法表示,当应用程序启动时,JARROOT/src/META-INF/resources下的所有内容都将装载到WAR根目录。所有这些都适用于CSS和Javascript文件,但Struts tiles则不然 这是我在罐子里的结构: base.jar |--src/ |----META-INF/ |------base.tld |------resources/ |--------ba

我正在使用新的Servlet3.0方法将web资源(如Javascript、CSS和JSP)打包到JAR文件中。该方法表示,当应用程序启动时,JARROOT/src/META-INF/resources下的所有内容都将装载到WAR根目录。所有这些都适用于CSS和Javascript文件,但Struts tiles则不然

这是我在罐子里的结构:

base.jar
|--src/
|----META-INF/
|------base.tld
|------resources/
|--------base/
|----------css/
|----------js/
|----------baseTiles.xml
在我的应用程序(WAR)web.xml中,我得到了以下信息:

<context-param>
    <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
    <param-value>/WEB-INF/tiles.xml,/base/baseTiles.xml</param-value>
</context-param>
你认为最重要的是什么

摘要和其他信息:

  • 使用JBoss eap 6.1 Alpha
  • 使用Struts 2.1.4
  • 基本JAR包含在WAR的lib目录中
  • 基本JAR包含上述所有文件(包括baseTiles.xml)

谢谢你的帮助

问题解决了!必须指向web.xml中的正确架构

<web-app version="3.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_3_1.xsd">


现在一切都是自动运行的

这是3.1 servlet规范的正确模式定义:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">