报了这个错:
java.lang.IllegalArgumentException: Path zoneListPage does not start with a "/" character
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
不知道为什么,急等江湖救急啊~,我的相关代码如下:1、在fw-tiles-defn.xml中如下定义:
……
<definition name="fw" path="/webclient/common/jsp/MainLayout.jsp">
<put name="Tree" value=".tree.controller" />
<put name="Tab" value=".tab.controller" />
<put name="MainPage" value="" />
</definition>
<definition name=".tree.controller"
path="/webclient/common/jsp/NavigationComponent.jsp" controllerClass="com.adventnet.nms.webclient.common.TreeAction" />
<definition name=".tab.controller"
path="/webclient/common/jsp/TabComponent.jsp"
controllerClass="com.adventnet.nms.webclient.common.TabAction" />
<definition name=".component.pagetraversal"
path="/webclient/common/jsp/PageNavigation.jsp"
controllerClass="com.adventnet.nms.webclient.common.PageTraversalController">
</definition>
<definition name="zoneListPage" extends="fw">
<put name="MainPage" value="zoneListDef"/>
</definition><definition name="zoneListDef" path="/webclient/common/jsp/listViewLayout.jsp">
<put name="PageIncludes" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listViewIncludes.jsp"/>
<put name="HeaderIncludes" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listHeaderInclude.jsp"/>
<put name="PageTraversal" value=".component.pagetraversal"/>
<put name="StatusMessage" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listViewStatus.jsp"/>
<put name="ListView" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/zoneList.jsp"/>
</definition>
……2、在fw-struts-config.xml中这样配置:……
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/webclient/ffcs/conf/configuration/fw/fw-tiles-defn.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
……3、在fw-struts-config.xml中相关映射部分:
……
<action path="/webclient/jsp/configuration/fw/zoneList"
type="cn.configuration.fw.ZoneAction"
name="zoneForm"
scope="request">
<forward name="zoneList" path="zoneListPage" contextRelative="true"/>
</action>
……4、调用时候用“http://……/webclient/jsp/configuration/fw/zoneList.do"
然后就报了如上的错,是不是在哪儿的配置没有配好?貌似没有识别到tiles的有关内容。
java.lang.IllegalArgumentException: Path zoneListPage does not start with a "/" character
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
不知道为什么,急等江湖救急啊~,我的相关代码如下:1、在fw-tiles-defn.xml中如下定义:
……
<definition name="fw" path="/webclient/common/jsp/MainLayout.jsp">
<put name="Tree" value=".tree.controller" />
<put name="Tab" value=".tab.controller" />
<put name="MainPage" value="" />
</definition>
<definition name=".tree.controller"
path="/webclient/common/jsp/NavigationComponent.jsp" controllerClass="com.adventnet.nms.webclient.common.TreeAction" />
<definition name=".tab.controller"
path="/webclient/common/jsp/TabComponent.jsp"
controllerClass="com.adventnet.nms.webclient.common.TabAction" />
<definition name=".component.pagetraversal"
path="/webclient/common/jsp/PageNavigation.jsp"
controllerClass="com.adventnet.nms.webclient.common.PageTraversalController">
</definition>
<definition name="zoneListPage" extends="fw">
<put name="MainPage" value="zoneListDef"/>
</definition><definition name="zoneListDef" path="/webclient/common/jsp/listViewLayout.jsp">
<put name="PageIncludes" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listViewIncludes.jsp"/>
<put name="HeaderIncludes" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listHeaderInclude.jsp"/>
<put name="PageTraversal" value=".component.pagetraversal"/>
<put name="StatusMessage" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listViewStatus.jsp"/>
<put name="ListView" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/zoneList.jsp"/>
</definition>
……2、在fw-struts-config.xml中这样配置:……
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/webclient/ffcs/conf/configuration/fw/fw-tiles-defn.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
……3、在fw-struts-config.xml中相关映射部分:
……
<action path="/webclient/jsp/configuration/fw/zoneList"
type="cn.configuration.fw.ZoneAction"
name="zoneForm"
scope="request">
<forward name="zoneList" path="zoneListPage" contextRelative="true"/>
</action>
……4、调用时候用“http://……/webclient/jsp/configuration/fw/zoneList.do"
然后就报了如上的错,是不是在哪儿的配置没有配好?貌似没有识别到tiles的有关内容。
页面的问题吧
抽空来接份^_^
可是它报那个错,是不是意味着它就没到fw-tiles-defn.xml中?
<definition name="zoneListPage" extends="fw">
<put name="MainPage" value="zoneListDef"/>
</definition>
注意以上我贴出的地方,value="zoneListDef"这里应该是你给出文件的路径。
比如/webclient/ffcs/jsp/xxxxxxx.jsp 而你这里只是zoneListDef。Path zoneListPage does not start with a "/" character 指zoneListPage 没有以/开头。
说的就是这。楼主好好检查吧。good luck
中的value属性改成你实际的jsp文件名.
楼上的正解.
<definition name="zoneListDef" path="/webclient/common/jsp/listViewLayout.jsp">
<put name="PageIncludes" value="/webclient/ffcs/jsp/configuration/fw/fwCfg/fwOption/listViewIncludes.jsp"/>
……
</definition> zoneListPage 不能以/开头吧,否则它就不是去fw-tiles-defn.xml里头找相关配置了,是这样么?
type :The type of the value. Can be: string, page, template or definition. By default, no type is associated to a value. If a type is associated, it will be used as a hint to process the value when the attribute will be used in the inserted tiles. A type of "string" indicates that the value should be inserted directly into the content of the page. A type of "page" or "template" indicates that the value is the URL of a page that should be included. A type of "definition" indicates that the value is the name of another Tiles definition that should be included in the page.
按照上面所说的。这么改一下试试
<put name="MainPage" value="zoneListDef" type="definition"/>
但是问题似乎不在这,我按照你说的改了,问题没有任何变化,因为它报的错是在zoneListPage这层的吧,我实在找不到错了,郁闷啊~
<action path="/webclient/jsp/configuration/fw/zoneList"
type="cn.configuration.fw.ZoneAction"
name="zoneForm"
scope="request">
<forward name="zoneList" path="zoneListPage" contextRelative="true"/>
</action>
应该是path="zoneListPage"这里的问题。难道说:没找到你的tiles文件?我有点怀疑了。呵呵
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/webclient/ffcs/conf/configuration/fw/fw-tiles-defn.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
这种东西。
我没有看过structs的源代码(比较懒),呵呵,反正加上后就能用了,具体原因我也不知道,别问我:)。不光是这个,包括资源文件,控制器等,都是一样的道理。
“<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/webclient/ffcs/conf/configuration/fw/fw-tiles-defn.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
”?to yxhzj:改成path=".zoneListPage",还是报那样的错。
2005-12-1 15:10:01 org.apache.struts.tiles.TilesRequestProcessor initDefinitionsMapping
信息: Tiles definition factory found for request processor ''.
……
2005-12-1 15:16:52 org.apache.struts.tiles.TilesPlugin init
信息: Tiles definition factory loaded for module ''.
我昨天按你说的试了一下,可是问题还存在,我想问题应该是存在module定义方面,因为我基于的那个平台并没象你说的那样定义,我完全按照那个平台已有的模块设置,就出了这个错。我再试着改改,问题解决了就散分啊,俺抱拳谢过大家伙了~^_^