struts问题 有一个页面地址为http://xxxx.com/landing.do?eventId=889900
页面有一个form 为
<form name="eventRegisterForm" method="POST" action="/eventRegister.do">
</form>
我点提交按钮时,浏览器的地址变为有一个页面地址为http://xxxx.com/eventRegister.do
我想如果出错时还是跳到原来的页面http://xxxx.com/landing.do?eventId=889900 可以怎么做呢
页面有一个form 为
<form name="eventRegisterForm" method="POST" action="/eventRegister.do">
</form>
我点提交按钮时,浏览器的地址变为有一个页面地址为http://xxxx.com/eventRegister.do
我想如果出错时还是跳到原来的页面http://xxxx.com/landing.do?eventId=889900 可以怎么做呢
<action name=""
input=""
/>或者
<action name="">
<forward name="success" path=""/>
<forward name="fail" path=""/>
</action>
如果是想让formbean验证出错跳转到前一页面,就配置input="/landing.do"。
如果是想让action处理出错跳转,就配置forward name="fail" path="/landing.do"。
如果上面两种方法还不能解决你的问题,那就使用转发request.getRequestDispatcher(url)或重定向response.sendRedirect(url)来解决。(url="http://xxxx.com/landing.do"eventId=889900)
<action name="">
<forward name="success" path=""/>
<forward name="fail" path=""/>
</action>