heting

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            40 隨筆 :: 9 文章 :: 45 評(píng)論 :: 0 Trackbacks

          struts.xml中配置攔截器和重復(fù)提交以后跳轉(zhuǎn)的頁(yè)面

          <action name="orderOk" class="foodShop"
             method
          ="orderOk">
               
          <interceptor-ref name="token"/>        
               
          <interceptor-ref name="defaultStack"/>   
            
          <result name="invalid.token" type="freemarker">/WEB-INF/outlook/food_01/error.html</result>
             
          <result type="freemarker">
              /WEB-INF/outlook/food_01/order_ok.html
             
          </result>
            
          </action>
          在頁(yè)面的表單中加入<@s.token>就可以了
          posted on 2008-11-21 11:57 賀挺 閱讀(2809) 評(píng)論(6)  編輯  收藏

          評(píng)論

          # re: struts2+freemarker中防止表單的重復(fù)提交token[未登錄](méi) 2011-03-02 16:02 zz
          你好。。我在freemarker的頁(yè)面調(diào)用了<@s.token> 報(bào)錯(cuò);
          java.lang.IllegalArgumentException: Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: Cannot create a session after the response has been committed
          at org.apache.struts2.util.TokenHelper.setToken(TokenHelper.java:77)
          請(qǐng)問(wèn)是怎么回事?  回復(fù)  更多評(píng)論
            

          # re: struts2+freemarker中防止表單的重復(fù)提交token 2012-06-05 22:28 licheng
          @zz
          我的也是  回復(fù)  更多評(píng)論
            

          # re: struts2+freemarker中防止表單的重復(fù)提交token 2015-04-23 09:15 51互聯(lián)云-濟(jì)南程序猿

          @licheng
          @zz

          必須在<from></from> 表單之中添加 <@s.token />

          注意 <@s.token /> 關(guān)閉標(biāo)簽。

          struts.xml文件 配置tokenSession 攔截器
            回復(fù)  更多評(píng)論
            

          # re: struts2+freemarker中防止表單的重復(fù)提交token 2015-12-29 16:06
          套頭  回復(fù)  更多評(píng)論
            

          # re: struts2+freemarker中防止表單的重復(fù)提交token 2015-12-29 16:07
          沒(méi)關(guān)系,大家好,什么都沒(méi)有  回復(fù)  更多評(píng)論
            

          # re: struts2+freemarker中防止表單的重復(fù)提交token 2015-12-29 16:08
          @51互聯(lián)云-濟(jì)南程序猿
          你什么都不懂,瞎說(shuō)  回復(fù)  更多評(píng)論
            


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 务川| 贡觉县| 乐平市| 扎鲁特旗| 临汾市| 富源县| 澳门| 武夷山市| 鄂伦春自治旗| 遵化市| 海门市| 三明市| 龙胜| 娱乐| 鄂尔多斯市| 光山县| 夏河县| 错那县| 潢川县| 武夷山市| 鄂尔多斯市| 东宁县| 安顺市| 栖霞市| 辛集市| 吉安市| 类乌齐县| 遂昌县| 沙雅县| 济宁市| 荔波县| 河北省| 宜春市| 阿坝县| 辽中县| 克东县| 金华市| 凤台县| 临邑县| 衡阳县| 武陟县|