简体   繁体   English

Tiles2无法与struts2一起使用

[英]Tiles2 not working with struts2

I am working on struts2 and using tiles in my application we use Netbeans7.1. 我正在研究struts2,并在我的应用程序中使用图块,我们使用Netbeans7.1。 But we got an error "The module has not been deployed.See the server log for details." 但是我们收到错误消息“模块尚未部署。有关详细信息,请参阅服务器日志。”

"Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule" “加载应用程序时出现异常:java.lang.IllegalStateException:ContainerBase.addChild:开始:org.apache.catalina.LifecycleException:java.lang.NoClassDefFoundError:org / apache / commons / digester / Rule”

we add listener in web.xml 我们在web.xml添加侦听器

web.xml file web.xml文件

 <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>

    <param-value>/WEB-INF/tiles.xml</param-value>

</context-param>

<listener>
    <listener-class>org.apache.tiles.web.startup.TilesListener</listener-class>
</listener>

struts.xml file struts.xml文件

Take a look at the Struts2 Tiles Plugin Documentation. 看一下Struts2 Tiles插件文档。

You web.xml should look a little bit different then yours. 您的web.xml应该看起来与您的有所不同。

<listener>
  <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>

And don't forget to add apache common digester jar to your lib folder. 并且不要忘记将apache通用的消化罐添加到您的lib文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM