S2SH 中 相同的请求只能调用1次action..没用令牌求解...一下代码:
html调用的代码
Action配置:<action name="infoInitAction" class="userInfoAction">
<result name="error">/flse.jsp</result>
<result name="sender">/OK.jsp</result>
<result name="csok">/userzz/infoMain.html</result>
</action>
<a id="sxx" href="infoInitAction" target="infor" onclick="clik()">收信箱</a><br>
不管是直接写href还是用url标签算过的url 只要url没变一个浏览器只能调用一次 infoInitAction的execute()方法除非关闭浏览器重新开下...否则绝对不会调用第二次= =怎么点击这个链接也不会..javascript也用过了...= =
实验了下
<a id="sxx" href="infoInitAction?afs=<%=Math.random() %>" target="infor" onclick="clik()">收信箱</a><br>
只有这样加上随即数改变请求链接后才会调用Action的方法..不过这样需要每次都刷新..= =..请问是配置什么了?我没有配置令牌= =...求解..初次接触S2SH= =

解决方案 »

  1.   

    <action name="addMemberChangeDietitian"
    class="com.jiushan.memberdietitian.action.AddMemberChangeDietitianAction"
    method="addMemberChangeDietitian">
    <interceptor-ref name="defaultStack" />
                <interceptor-ref name="token" />
                <result name="invalid.token">/foreground/memberdietitian/success.jsp</result>  
    <result name="success">/foreground/memberdietitian/success.jsp</result>
    </action>
    令牌我也不懂,你直接在配置文件的action中加上这个,试试效果吧
      

  2.   

    <interceptor-ref name="defaultStack" />
                <interceptor-ref name="token" />
                <result name="invalid.token">/foreground/memberdietitian/success.jsp</result>  这三行就是令牌的,加在你result的上面就可以,他的result是当重复的时候跳转的路径
      

  3.   

    貌似我说的不清楚..o(╯□╰)o..我是说..我这已经是点击链接只能调用一次action 我想每点击一次就调用一次action的方法...
      

  4.   

    spring 中userInfoAction这个bean是怎么配置的? scope可以配置成prototype
      

  5.   

    LZ 没有吧自己想问的问题说明白!onclick="clik()" 中的clik() 贴出来看下
      

  6.   

    貌似是spring里的scope="prototype",加上这个看看
      

  7.   

    spring中的配置...没用啊= =...完全不调用..换了3个浏览器了..还是不能重复调用<bean id="userInfoAction" class="com.bean.action.UserInfoAction" autowire="byType" scope="prototype"/>
      

  8.   

    啊哈..解决了..就是浏览器缓存的原因: 解决办法 在调用的方法添加如下方法:
    很奇怪啊..那位大哥能帮忙解释下为什么啊?protected final void setPageExpired() {
        HttpServletResponse reponse=ServletActionContext.getResponse();
        reponse.addHeader("Cache-Control", "no-cache");
        reponse.addHeader("Expires",
        "Thu, 01 Jan 1970 00:00:01 GMT");
    }
      

  9.   

    <interceptor-ref name="defaultStack" />
                <interceptor-ref name="token" />
                <result name="invalid.token">/foreground/memberdietitian/success.jsp</result>