You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/09/29 18:18:29 UTC

Refresh problem

Hi,

I have a screen which lists some names in a table and has a delete option 
which calls an action to delete the associated name and then the view page 
shows the updated list.
If you do a delete and then select refresh on the browser, the resulting 
request is for another delete which is clearly undesirable.  I am trying to 
use tokens to fix this but always get a false from the call to (NOT) 
istokenValid (i.e., I cannot now do the delete at all).

my struts-config enties are:

  <action path="/viewNames"
             type="com.me.test.actions.SetTokenAction">
            <forward
                    name="success"
                    path="fulluser.names.view"/>					       </action>

  <action path="/deleteName"
             type="com.me.test.actions.DeleteNameAction">
            <forward
                    name="success"
                    path="/do/viewNames"/>
</action>

and the actions are:
[SetTokenAction]
  ....
  saveToken(request);
  return (mapping.findForward("success"));

[DeleteNameAction]

  ....
  if (!isTokenValid(request))
    return (mapping.findForward("success"));

// do the delete
.....

// reset the token
resetToken(request);


When in the view page, both clicking delete and doing a refresh change the 
token's value.
The Action class API states that the 'isTokenValid' method compares the 
session token with the one in the request but I never see one in the 
request.

The logic seems sound so am I missing something (except a servicable brain)?

Thanks,
Andy

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org