You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gus Delgado <gd...@oceanobjects.com> on 2002/11/04 17:02:36 UTC

Re: back button

I'm trying to use the saveToken function but is not working here is what 
I have: a parameter called "action"  

 if("save".equals(request.getParameter("action")))
{
        if(!isTokenValid(request)){
            System.out.println("our of transaction order");
            resetToken(request);
       }
       //save stuff
}
else if("validate".equals(request.getParameter("action")))
{
        saveToken(request); 
        //validate stuff

}

any inside will be very helpful

thanks
gus
Trieu, Danny wrote:

>No-cache settings in the controller will make sure that every response going
>Through the controller will have its head setting to no-cache on the user 
>Browser.  Meaning, the content on the user browser get expired as the user
>Going to another page, and so when the user click the back button the
>browser
>Will request to the server for the new contents of whatever on the history 
>Stack.  With transaction token, if there is a match meaning you have a good
>Transaction, a sync with the current state, and you can go on and process
>The request.  Else, there isn't a match with the token which mean out of
>sync
>Then you can handle the condition as if it is out of sync.
>
>Hope this would help.
>
>danny
>
>-----Original Message-----
>From: Gus Delgado [mailto:gdelgado@oceanobjects.com] 
>Sent: Wednesday, October 30, 2002 8:49 AM
>To: Struts Users Mailing List
>Subject: Re: back button
>
>
>please explain the controller to no-cache part?
>
>Trieu, Danny wrote:
>
>  
>
>>Use transaction token to guaranty your transaction.  And don't forget 
>>To set your controller to no-cache.
>>
>>-----Original Message-----
>>From: David Graham [mailto:dgraham1980@hotmail.com]
>>Sent: Wednesday, October 30, 2002 7:29 AM
>>To: struts-user@jakarta.apache.org
>>Subject: Re: back button
>>
>>
>>That is an absolutely hideous solution to the problem.  Breaking the 
>>user's
>>back button will only make them angry.
>>
>>David
>>
>>
>>
>> 
>>
>>    
>>
>>>From: "Affan Qureshi" <qu...@etilize.com>
>>>Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>Subject: Re: back button
>>>Date: Wed, 30 Oct 2002 19:47:39 +0500
>>>
>>>You can disable the back button by using JavaScript history.forward()
>>>at
>>>the
>>>top of your page. But i dont know if that solves your problem.
>>>
>>>----- Original Message -----
>>>From: "Gus Delgado" <gd...@oceanobjects.com>
>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>Sent: Wednesday, October 30, 2002 6:38 PM
>>>Subject: back button
>>>
>>>
>>>   
>>>
>>>      
>>>
>>>>I have a JSP that has a sequence of actions.  First one is
>>>>"validate" which will validate some IO File and the next one is 
>>>>"load" to load the file.
>>>>
>>>>When the user hits "validate" it sends a request to the back-end to
>>>>do some validation and I get back a response.  When I hit Load it 
>>>>sends a request to the back-end to persist that file.
>>>>
>>>>the Load button depends on the validation button.  When click
>>>>validate and get an ok response, load shows.
>>>>
>>>>The problem is the back button on the browser, the file is already
>>>>validated but if I hit the back button the ui and the back-end are 
>>>>our of sync I can validate again.
>>>>
>>>>Any one run into this problem? how can it be handlel?  thanks.
>>>>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>>     
>>>>
>>>>        
>>>>
>>><ma...@jakarta.apache.org>
>>>   
>>>
>>>      
>>>
>>>>For additional commands, e-mail:
>>>>     
>>>>
>>>>        
>>>>
>>><ma...@jakarta.apache.org>
>>>   
>>>
>>>--
>>>To unsubscribe, e-mail:   
>>><ma...@jakarta.apache.org>
>>>For additional commands, e-mail: 
>>><ma...@jakarta.apache.org>
>>>   
>>>
>>>      
>>>
>>_________________________________________________________________
>>Surf the Web without missing calls! Get MSN Broadband.
>>http://resourcecenter.msn.com/access/plans/freeactivation.asp
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>--
>>To unsubscribe, e-mail:
>>    
>>
><ma...@jakarta.apache.org>
>  
>
>>For additional commands, e-mail:
>>    
>>
><ma...@jakarta.apache.org>
>  
>
>>.
>>
>> 
>>
>>    
>>
>
>
>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>.
>
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: back button

Posted by Gus Delgado <gd...@oceanobjects.com>.
Can the isTokenValid and saveToken be in the same Action ?


Gus Delgado wrote:

> I'm trying to use the saveToken function but is not working here is 
> what I have: a parameter called "action" 
> if("save".equals(request.getParameter("action")))
> {
>        if(!isTokenValid(request)){
>            System.out.println("our of transaction order");
>            resetToken(request);
>       }
>       //save stuff
> }
> else if("validate".equals(request.getParameter("action")))
> {
>        saveToken(request);        //validate stuff
>
> }
>
> any inside will be very helpful
>
> thanks
> gus
> Trieu, Danny wrote:
>
>> No-cache settings in the controller will make sure that every 
>> response going
>> Through the controller will have its head setting to no-cache on the 
>> user Browser.  Meaning, the content on the user browser get expired 
>> as the user
>> Going to another page, and so when the user click the back button the
>> browser
>> Will request to the server for the new contents of whatever on the 
>> history Stack.  With transaction token, if there is a match meaning 
>> you have a good
>> Transaction, a sync with the current state, and you can go on and 
>> process
>> The request.  Else, there isn't a match with the token which mean out of
>> sync
>> Then you can handle the condition as if it is out of sync.
>>
>> Hope this would help.
>>
>> danny
>>
>> -----Original Message-----
>> From: Gus Delgado [mailto:gdelgado@oceanobjects.com] Sent: Wednesday, 
>> October 30, 2002 8:49 AM
>> To: Struts Users Mailing List
>> Subject: Re: back button
>>
>>
>> please explain the controller to no-cache part?
>>
>> Trieu, Danny wrote:
>>
>>  
>>
>>> Use transaction token to guaranty your transaction.  And don't 
>>> forget To set your controller to no-cache.
>>>
>>> -----Original Message-----
>>> From: David Graham [mailto:dgraham1980@hotmail.com]
>>> Sent: Wednesday, October 30, 2002 7:29 AM
>>> To: struts-user@jakarta.apache.org
>>> Subject: Re: back button
>>>
>>>
>>> That is an absolutely hideous solution to the problem.  Breaking the 
>>> user's
>>> back button will only make them angry.
>>>
>>> David
>>>
>>>
>>>
>>>
>>>
>>>   
>>>
>>>> From: "Affan Qureshi" <qu...@etilize.com>
>>>> Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>> Subject: Re: back button
>>>> Date: Wed, 30 Oct 2002 19:47:39 +0500
>>>>
>>>> You can disable the back button by using JavaScript history.forward()
>>>> at
>>>> the
>>>> top of your page. But i dont know if that solves your problem.
>>>>
>>>> ----- Original Message -----
>>>> From: "Gus Delgado" <gd...@oceanobjects.com>
>>>> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>> Sent: Wednesday, October 30, 2002 6:38 PM
>>>> Subject: back button
>>>>
>>>>
>>>>  
>>>>     
>>>>
>>>>> I have a JSP that has a sequence of actions.  First one is
>>>>> "validate" which will validate some IO File and the next one is 
>>>>> "load" to load the file.
>>>>>
>>>>> When the user hits "validate" it sends a request to the back-end to
>>>>> do some validation and I get back a response.  When I hit Load it 
>>>>> sends a request to the back-end to persist that file.
>>>>>
>>>>> the Load button depends on the validation button.  When click
>>>>> validate and get an ok response, load shows.
>>>>>
>>>>> The problem is the back button on the browser, the file is already
>>>>> validated but if I hit the back button the ui and the back-end are 
>>>>> our of sync I can validate again.
>>>>>
>>>>> Any one run into this problem? how can it be handlel?  thanks.
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> To unsubscribe, e-mail:
>>>>>    
>>>>>       
>>>>
>>>> <ma...@jakarta.apache.org>
>>>>  
>>>>     
>>>>
>>>>> For additional commands, e-mail:
>>>>>    
>>>>>       
>>>>
>>>> <ma...@jakarta.apache.org>
>>>>  
>>>> -- 
>>>> To unsubscribe, e-mail:   
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail: 
>>>> <ma...@jakarta.apache.org>
>>>>  
>>>>     
>>>
>>> _________________________________________________________________
>>> Surf the Web without missing calls! Get MSN Broadband.
>>> http://resourcecenter.msn.com/access/plans/freeactivation.asp
>>>
>>>
>>> -- 
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>>
>>> -- 
>>> To unsubscribe, e-mail:
>>>   
>>
>> <ma...@jakarta.apache.org>
>>  
>>
>>> For additional commands, e-mail:
>>>   
>>
>> <ma...@jakarta.apache.org>
>>  
>>
>>> .
>>>
>>>
>>>
>>>   
>>
>>
>>
>>
>>
>> -- 
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>> -- 
>> To unsubscribe, e-mail:   
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail: 
>> <ma...@jakarta.apache.org>
>>
>>
>> .
>>
>>  
>>
>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>
> .
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>