Hi

In my investigations on Struts I have developed yet another BaseAction class (based on 
the Template design pattern) so I can put all common processing for actions in one 
place.  In this class I use the methods resetToken, saveToken to ensure that ALL 
transactional actions are checked to see if they double posts.  Isend a new togen with 
every GET request and check for token validity with every POST request.  After all 
that is what GETs and POSTs were designed for.

I think I have done something useful.  But this seems such an obvious thing to do that 
I am wondering why has it not been done before and included within the Struts code.  
Have I missed a flaw in my approach?

In summary

BaseAction extends Action

execute (mapping, form,request,response) {

if request is POST then
  if  double post then
    forward to warning page
  end if;
  resetToken
else
  savetoken
end if

}

Comments

Stuart Dentt

Reply via email to