我有一个巨大的struts.xml文件,我想在我的struts文件中添加一些逻辑。我决定将它拆分为许多文件,如:
支柱-users.xml中 支柱-tvshows.xml
我的struts.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true"></constant>
<constant name="struts.devMode" value="true"></constant>
<constant name="struts.custom.i18n.resources" value="package"></constant>
<include file="struts-user.xml" />
<include file="struts-tvshows.xml" />
</struts>
我遇到了这个错误:启动struts2过滤器
的异常异常堆栈跟踪说:引起:位置名称'frontoffice'位置...(我的struts-tvshows.xml位置的位置)。
所以我的错误来自于我在两个文件中定义了名为“frontoffice”的包。我必须将所有行动都放在同一个包裹中......
有人有线索吗?
答案 0 :(得分:1)
AFAIK您无法跨多个配置文件定义包。我不明白为什么你需要将它们保存在同一个包中,但是 - 包名完全是任意的。
如果您关心的是现有的包定义,只需让新包扩展该包。
从包含文件的名称看起来没有理由将它们保存在同一个包中,因为它们出现以具有完全不相关的功能。