在struts.xml文件中使用“** constant **”时出现错误(strust 2.3.4框架)

时间:2012-07-13 08:48:13

标签: struts2

我正在尝试使用框架strust2.3.4运行项目,但是会发生错误 当我在struts.xml文件中使用“常量”时

<constant name="struts.convention.action.packages" value="com.pfs.pnn.action"/>

和配置操作

<action name="system_list" class="SystemListAction">
     <result name="success">/pages/system_list.jsp</result>
</action>

错误:

Caused by: Action class [SystemListAction] not found - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/pnn/WEB-INF/classes/struts.xml:8:58
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:434)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:378)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:495)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:286)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:234)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
    ... 16 more

我不知道哪里出错。请帮助我!

1 个答案:

答案 0 :(得分:0)

添加struts2convention插件,不提完整包 <constant name="struts.convention.action.packages" value="action"/> 更多 链接https://cwiki.apache.org/confluence/display/WW/Convention%20Plugin