You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Riyaz Mansoor <rm...@yahoo.com> on 2003/06/09 05:39:12 UTC

using struts token

hi

i want to use struts tokens to (un)process duplicate submissions. however, i
could not find out anything about using tokens in any of the sample apps
that come with struts.

1) is there a sample application which demonstrates using tokens in struts?

2) i'm not using the struts html tag library to display forms or form
controls. would this be a problem? would i have to do extra work if so?


thanx

riyaz


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


Re: [OT] Logging.. when to use it

Posted by Marco Tedone <mt...@jemos.org>.
It is useful for system administrator and application developer's to monitor
system activity, bugs and warnings under a technical point of view. It's
useful to the management, for instance, to monitor sites performance and
take the right decisions.

Marco
----- Original Message ----- 
From: "Vijay Pawar" <vs...@orgltd.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, June 09, 2003 5:54 AM
Subject: [OT] Logging.. when to use it


> Hi All,
>
> I wish to know when to use the logging.
>
> What are the application senarios where logging will be useful. I mean to
> say that what will be the ideal situations where logging can be used.
>
> I would appreciate an eye opening reply for this.
>
> Cheers
>
> Vijay
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>




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


RE: [OT] Logging.. when to use it

Posted by Mike Jasnowski <mj...@bea.com>.
You can also use logging to trace execution of a thread through various
subsystems of an application.  Which can especially be handing in
multi-threaded apps, and logs that may have unsynchronized access to
different parts placed in them. Assuming you log thread id or a correlation
id of some sort of course.

-----Original Message-----
From: Erik Price [mailto:eprice@ptc.com]
Sent: Monday, June 09, 2003 12:48 PM
To: Struts Users Mailing List
Subject: Re: [OT] Logging.. when to use it




Vijay Pawar wrote:
> Hi All,
>
> I wish to know when to use the logging.
>
> What are the application senarios where logging will be useful. I mean to
> say that what will be the ideal situations where logging can be used.
>
> I would appreciate an eye opening reply for this.

Helpful for debugging.



Erik


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



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


Re: [OT] Logging.. when to use it

Posted by Erik Price <ep...@ptc.com>.

Vijay Pawar wrote:
> Hi All,
> 
> I wish to know when to use the logging.
> 
> What are the application senarios where logging will be useful. I mean to
> say that what will be the ideal situations where logging can be used.
> 
> I would appreciate an eye opening reply for this.

Helpful for debugging.



Erik


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


[OT] Logging.. when to use it

Posted by Vijay Pawar <vs...@orgltd.com>.
Hi All,

I wish to know when to use the logging.

What are the application senarios where logging will be useful. I mean to
say that what will be the ideal situations where logging can be used.

I would appreciate an eye opening reply for this.

Cheers

Vijay

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


Re: using struts token

Posted by Rick Reumann <r...@reumann.net>.
On Mon, Jun 09,'03 (08:39 AM GMT+0500), Riyaz wrote: 
  
> 1) is there a sample application which demonstrates using tokens in
> struts?

Actually I didn't find the Struts example app using the token stuff too
well. Maybe the example has changed though since it's been a while since
I looked at, but way back when I didn't find it too helpful.

Here's how I use it....

In your action or dispatch that is called right before you end up
fowarding to your form you do this:

 saveToken( request );

Then in your action that is doing your save/update you need to check
that this token is valid so that you don't have a duplicate
update/insert... so you do...


if ( isTokenValid( request ) ) {
                //do your save/update whatever
                bean.save();
		//reset the token
                resetToken(ae.getReq());
		//save new token back in request
                saveToken(ae.getReq() );
            }
else // save an error message that they are trying a duplicate entry by
hitting refresh, forward to an error page or back to the form

I'm not sure if the above it the way other people, smarter than myself,
do it, but it works for me.

  
> 2) i'm not using the struts html tag library to display forms or form
> controls. would this be a problem? would i have to do extra work if
> so?

Like David said, you'll have to do this manually if you don't use the
form tag. Use the form tag! (Why aren't you using it??:)


-- 
Rick


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