Struts和Tiles错误! <forward name="success" path="/BasePage" /> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的意思是 forward到 "/layout.jsp" 不能写成 definition的名字(BasePage) 在 forward 中不能写成 BasePage 要直接写 .jsp如果成功后要跳回的话最好在 action 中写 request.sendRedirect("你的回跳地址") <action path="/viewrecesms" type="com.meip.ReceiveAction" scope="request"> <forward name="success" path="BasePage" /></action>这里错了吧,应该是<forward name="success" path="/BasePage.jsp" />而且你的路径要是对的 按楼主的写法应该可以的,试试<forward name="success" path="BasePage" redirect="false" /> 1. index.jsp中<logic:forward name="welcome" />2.struts-config.xml中<global-forwards><forward name="welcome" path="page.welcome" redirect="true" /></global-forwards>结果tomcat报错说找不到page.welcome但是如果通过一个action。在action中指定forward为page.welcome,又是可以的。是不是不能在global forward中指定目标为一个tiles页面啊? <forward name="success" path="/BasePage" /> 测试成功<action path="/index" type="org.apache.struts.actions.ForwardAction" parameter="page.welcome"></action><global-forwards><forward name="welcome" path="/index.do" redirect="true" /></global-forwards> 不懂就不要乱说楼主的问题可能是tiles的plugin没有启动<plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" /> </plug-in>我这样用就可以了 eclipse保存问题(新手上路……) hibernate中如何配置SqlServer2005? 请教大家一个hibernate的问题 数据库数据同步问题 程序怎么实现???? 问大家几个关于jfreechart的问题,会几个答几个哈 struts2国际化action里的 在校软件工程学生该如何为自己的职业java生涯作准备。 初学JAVA,一点肤浅的认识,不知对不对? 找高手,看下这个国际期货的即时行情有谁做过?或者公司有这样的东西?请联系我 struts+validate+客户端验证 问题 这个问题好难! 有无想过35岁之后,你能做什么?
不能写成 definition的名字(BasePage)
如果成功后要跳回的话最好在 action 中写 request.sendRedirect("你的回跳地址")
<forward name="success" path="BasePage" />
</action>
这里错了吧,应该是<forward name="success" path="/BasePage.jsp" />
而且你的路径要是对的
2.struts-config.xml中
<global-forwards>
<forward name="welcome" path="page.welcome" redirect="true" />
</global-forwards>结果tomcat报错说找不到page.welcome但是如果通过一个action。在action中指定forward为page.welcome,又是可以的。
是不是不能在global forward中指定目标为一个tiles页面啊?
<action path="/index" type="org.apache.struts.actions.ForwardAction"
parameter="page.welcome">
</action>
<global-forwards>
<forward name="welcome" path="/index.do" redirect="true" />
</global-forwards>
楼主的问题可能是tiles的plugin没有启动
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property
property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
</plug-in>
我这样用就可以了