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   可以怎么做呢

解决方案 »

  1.   

    在相对应的action中配置input属性应该可以的.
    <action name=""
            input=""
    />或者
    <action name="">
        <forward name="success" path=""/>
        <forward name="fail" path=""/>
    </action>
      

  2.   

    在struts-config.xml中配置一个 input 属性..把input的值设置成出错的url,如果出错.就会跳转到这个页面上面.
      

  3.   

    推荐2楼的,一般可以再struts里面指向一个专门的错误页面
      

  4.   

    struts-config.xml配置input 或forward跳转就可以实现。
    如果是想让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) 
      

  5.   


    <action name="">
        <forward name="success" path=""/>
        <forward name="fail" path=""/>
    </action>
      

  6.   

    <action name=""  input=""/>在input属性加就可以了。