You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Juan Espinosa <pc...@adinet.com.uy> on 2004/03/12 10:39:19 UTC

Re: Thread Safe Action

hi everyone, i need information about struts, but no begginer information,
im developing applications with struts and i want to know how it works
internally
i want to know what is a requestproccessor for example, how works strust
since i press a button in a web page etc etc
if somebody have or know where to find this kind of information.....(papers,
blue prints, class diagrams)

thank you all of you

john
Shout America
Montevideo - Uruguay

----- Original Message ----- 
From: "Niall Pemberton" <ni...@blueyonder.co.uk>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, March 12, 2004 2:31 PM
Subject: Re: Thread Safe Action


> Shahak is correct except its not "one action object per JVM"  - its "one
> action object per Struts module".
>
> Struts uses a separate RequestProcessor for each module, the
> RequestProcessor stores a single instance of each different Action class
in
> your module, which it re-uses.
>
> Niall
>
> ----- Original Message ----- 
> From: <Sh...@ngc.com>
> To: <st...@jakarta.apache.org>
> Sent: Friday, March 12, 2004 12:57 PM
> Subject: RE: Thread Safe Action
>
>
> Correct: Struts instantiates only one action object (per JVM), so all
> variables should be locally (method)-scoped.
>
> Class variables (statics--typically for constants) are fine, but nothing
> that's tied to a particular request or user.
>
> -----Original Message-----
> From: Joao Batistella [mailto:joao-p-batistella@ptinovacao.pt]
> Sent: Friday, March 12, 2004 7:53 AM
> To: 'Struts Users Mailing List'
> Subject: Thread Safe Action
>
>
> Hello.
>
> I read that an Action in struts can be shared among another requests.
> This
> means that we shouldn't use class attributes in the logic that response
> a
> request?
>
> Thanks,
> JP
>
> ---------------------------------------------------------------------
> 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
>


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


Re: Thread Safe Action

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
In Struts 1.0 ActionServlet was the "guts" of struts with all the processing
logic for a request. In Struts 1.1 the processing logic for a request was
re-factored out into the RequestProcessor. If you want to understand what
happens when struts receieves a request then look at the process() method in
RequestProcessor.

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/action/RequestProcessor.java

Each struts module has a RequestProcessor, if you don't specify it in the
struts-config.xml then you just get the default one (unless your using
Tiles). If you want to configure struts to use your own version of
RequestProcessor then you can do so in the <controller> element of
struts-config.xml

http://jakarta.apache.org/struts/userGuide/configuration.html#controller_config

I think the best way to understand struts is "look at the source", but other
than that a good start is to read the User Manual

http://jakarta.apache.org/struts/userGuide/index.html

Niall

----- Original Message ----- 
From: "Juan Espinosa" <pc...@adinet.com.uy>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, March 12, 2004 9:39 AM
Subject: Re: Thread Safe Action


> hi everyone, i need information about struts, but no begginer information,
> im developing applications with struts and i want to know how it works
> internally
> i want to know what is a requestproccessor for example, how works strust
> since i press a button in a web page etc etc
> if somebody have or know where to find this kind of
information.....(papers,
> blue prints, class diagrams)
>
> thank you all of you
>
> john
> Shout America
> Montevideo - Uruguay
>
> ----- Original Message ----- 
> From: "Niall Pemberton" <ni...@blueyonder.co.uk>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, March 12, 2004 2:31 PM
> Subject: Re: Thread Safe Action
>
>
> > Shahak is correct except its not "one action object per JVM"  - its "one
> > action object per Struts module".
> >
> > Struts uses a separate RequestProcessor for each module, the
> > RequestProcessor stores a single instance of each different Action class
> in
> > your module, which it re-uses.
> >
> > Niall
> >
> > ----- Original Message ----- 
> > From: <Sh...@ngc.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Friday, March 12, 2004 12:57 PM
> > Subject: RE: Thread Safe Action
> >
> >
> > Correct: Struts instantiates only one action object (per JVM), so all
> > variables should be locally (method)-scoped.
> >
> > Class variables (statics--typically for constants) are fine, but nothing
> > that's tied to a particular request or user.
> >
> > -----Original Message-----
> > From: Joao Batistella [mailto:joao-p-batistella@ptinovacao.pt]
> > Sent: Friday, March 12, 2004 7:53 AM
> > To: 'Struts Users Mailing List'
> > Subject: Thread Safe Action
> >
> >
> > Hello.
> >
> > I read that an Action in struts can be shared among another requests.
> > This
> > means that we shouldn't use class attributes in the logic that response
> > a
> > request?
> >
> > Thanks,
> > JP
> >
> > ---------------------------------------------------------------------
> > 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
> >
>
>
> ---------------------------------------------------------------------
> 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