You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@gmail.com on 2007/06/19 22:53:11 UTC

Spring Action Instantiation

It appears as though I am not getting a new Action instance created for each
req

-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by Musachy Barroso <mu...@gmail.com>.
That looks right to me :)

musachy

On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
>
> <!-- Actions -->
>     <bean id="pufAction" class="actions.PayrollUpdateAction"
> scope="prototype" >
>         <property name="payrollUpdate" ref="anUpdate"/>
>     </bean>
>
>
>
>         <!-- Add actions here -->
>         <action name="PayrollUpdate_*" method="{1}" class="pufAction">
>             <result name="input">PayrollUpdate</result>
>             <result name="list">PayrollUpdate_list</result>
>             <result name="add">PayrollUpdate</result>
>             <result name="show">PayrollUpdate</result>
>             <result name="edit">PayrollUpdate</result>
>             <result name="destroy">PayrollUpdate</result>
>             <result name="notes"
> type="chain">PayrollUpdateNotes_list</result>
>         </action>
>
> On 6/20/07, Musachy Barroso <mu...@gmail.com> wrote:
> >
> > That should be it, and scope=prototype  has always done the trick for
> me,
> > why don't you post relevant parts of the spring conf file?
> >
> > regards
> > musachy
> >
> > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > >
> > > Oooop!  The struts.xml change did not force the context to
> reload!  Now
> > > that
> > > I have changed the class in the action mapping to the fully qualified
> > > class
> > > name, it *is* being instantiated on each request!  So why is it not
> > > working
> > > with the Spring bean id?
> > >
> > > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > > >
> > > > I replaced the spring bean id in my action mapping with the fully
> > > > qualified class name to rule Spring out completely.  I am still
> never
> > > seeing
> > > > the log4j output in the constructor of my action class!  I have
> double
> > > > checked my log4j.properties and the debug output would be written
> out
> > if
> > > > the constructor were called.
> > > >
> > > > Any ideas?  Could this have anything to do with an interceptor?
> > > >
> > > > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > > > >
> > > > > I'm using Spring 2.x and the attribute scope="prototype"
> > > > >
> > > > > On 6/19/07, Zarar Siddiqi < zarars@gmail.com > wrote:
> > > > > >
> > > > > >
> > > > > > It sounds to me like your Action class might be configured as a
> > > > > > singleton.
> > > > > > If that's the case the action class' constructor would only be
> > > called
> > > > > > once
> > > > > > on startup.  Make sure you have singleton="false" in your Spring
> > > > > > config for
> > > > > > the action class.  The default value for singleton is true.
> > > > > >
> > > > > >
> > > > > >
> > > > > > stanlick wrote:
> > > > > > >
> > > > > > > It appears as though I am not getting a new Action instance
> > > created
> > > > > > for
> > > > > > > each
> > > > > > > request!  I have placed a logging statement in the constructor
> > of
> > > my
> > > > > > > Action
> > > > > > > class and it is not emitting output.  The Bean inside the
> Action
> > > > > > *is*
> > > > > > > emitting log statements from its constructor so I must have
> the
> > > > > > Spring
> > > > > > > beans
> > > > > > > wired correctly.  I am injecting both the Actions and Action
> > Beans
> > > > > > via
> > > > > > > Spring.  I have scope=prototype on them both.
> > > > > > >
> > > > > > > Any ideas?
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Scott
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > >
> > >
> >
> http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> > > > > > Sent from the Struts - User mailing list archive at Nabble.com.
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Scott
> > > > > stanlick@gmail.com
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Scott
> > > > stanlick@gmail.com
> > >
> > >
> > >
> > >
> > > --
> > > Scott
> > > stanlick@gmail.com
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> --
> Scott
> stanlick@gmail.com
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: Spring Action Instantiation

Posted by st...@gmail.com.
<!-- Actions -->
    <bean id="pufAction" class="actions.PayrollUpdateAction"
scope="prototype" >
        <property name="payrollUpdate" ref="anUpdate"/>
    </bean>



        <!-- Add actions here -->
        <action name="PayrollUpdate_*" method="{1}" class="pufAction">
            <result name="input">PayrollUpdate</result>
            <result name="list">PayrollUpdate_list</result>
            <result name="add">PayrollUpdate</result>
            <result name="show">PayrollUpdate</result>
            <result name="edit">PayrollUpdate</result>
            <result name="destroy">PayrollUpdate</result>
            <result name="notes"
type="chain">PayrollUpdateNotes_list</result>
        </action>

On 6/20/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> That should be it, and scope=prototype  has always done the trick for me,
> why don't you post relevant parts of the spring conf file?
>
> regards
> musachy
>
> On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> >
> > Oooop!  The struts.xml change did not force the context to reload!  Now
> > that
> > I have changed the class in the action mapping to the fully qualified
> > class
> > name, it *is* being instantiated on each request!  So why is it not
> > working
> > with the Spring bean id?
> >
> > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > >
> > > I replaced the spring bean id in my action mapping with the fully
> > > qualified class name to rule Spring out completely.  I am still never
> > seeing
> > > the log4j output in the constructor of my action class!  I have double
> > > checked my log4j.properties and the debug output would be written out
> if
> > > the constructor were called.
> > >
> > > Any ideas?  Could this have anything to do with an interceptor?
> > >
> > > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > > >
> > > > I'm using Spring 2.x and the attribute scope="prototype"
> > > >
> > > > On 6/19/07, Zarar Siddiqi < zarars@gmail.com > wrote:
> > > > >
> > > > >
> > > > > It sounds to me like your Action class might be configured as a
> > > > > singleton.
> > > > > If that's the case the action class' constructor would only be
> > called
> > > > > once
> > > > > on startup.  Make sure you have singleton="false" in your Spring
> > > > > config for
> > > > > the action class.  The default value for singleton is true.
> > > > >
> > > > >
> > > > >
> > > > > stanlick wrote:
> > > > > >
> > > > > > It appears as though I am not getting a new Action instance
> > created
> > > > > for
> > > > > > each
> > > > > > request!  I have placed a logging statement in the constructor
> of
> > my
> > > > > > Action
> > > > > > class and it is not emitting output.  The Bean inside the Action
> > > > > *is*
> > > > > > emitting log statements from its constructor so I must have the
> > > > > Spring
> > > > > > beans
> > > > > > wired correctly.  I am injecting both the Actions and Action
> Beans
> > > > > via
> > > > > > Spring.  I have scope=prototype on them both.
> > > > > >
> > > > > > Any ideas?
> > > > > >
> > > > > > Thanks,
> > > > > > Scott
> > > > > >
> > > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> >
> http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> > > > > Sent from the Struts - User mailing list archive at Nabble.com.
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Scott
> > > > stanlick@gmail.com
> > >
> > >
> > >
> > >
> > > --
> > > Scott
> > > stanlick@gmail.com
> >
> >
> >
> >
> > --
> > Scott
> > stanlick@gmail.com
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by Musachy Barroso <mu...@gmail.com>.
That should be it, and scope=prototype  has always done the trick for me,
why don't you post relevant parts of the spring conf file?

regards
musachy

On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
>
> Oooop!  The struts.xml change did not force the context to reload!  Now
> that
> I have changed the class in the action mapping to the fully qualified
> class
> name, it *is* being instantiated on each request!  So why is it not
> working
> with the Spring bean id?
>
> On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> >
> > I replaced the spring bean id in my action mapping with the fully
> > qualified class name to rule Spring out completely.  I am still never
> seeing
> > the log4j output in the constructor of my action class!  I have double
> > checked my log4j.properties and the debug output would be written out if
> > the constructor were called.
> >
> > Any ideas?  Could this have anything to do with an interceptor?
> >
> > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > >
> > > I'm using Spring 2.x and the attribute scope="prototype"
> > >
> > > On 6/19/07, Zarar Siddiqi < zarars@gmail.com > wrote:
> > > >
> > > >
> > > > It sounds to me like your Action class might be configured as a
> > > > singleton.
> > > > If that's the case the action class' constructor would only be
> called
> > > > once
> > > > on startup.  Make sure you have singleton="false" in your Spring
> > > > config for
> > > > the action class.  The default value for singleton is true.
> > > >
> > > >
> > > >
> > > > stanlick wrote:
> > > > >
> > > > > It appears as though I am not getting a new Action instance
> created
> > > > for
> > > > > each
> > > > > request!  I have placed a logging statement in the constructor of
> my
> > > > > Action
> > > > > class and it is not emitting output.  The Bean inside the Action
> > > > *is*
> > > > > emitting log statements from its constructor so I must have the
> > > > Spring
> > > > > beans
> > > > > wired correctly.  I am injecting both the Actions and Action Beans
> > > > via
> > > > > Spring.  I have scope=prototype on them both.
> > > > >
> > > > > Any ideas?
> > > > >
> > > > > Thanks,
> > > > > Scott
> > > > >
> > > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> > > > Sent from the Struts - User mailing list archive at Nabble.com.
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Scott
> > > stanlick@gmail.com
> >
> >
> >
> >
> > --
> > Scott
> > stanlick@gmail.com
>
>
>
>
> --
> Scott
> stanlick@gmail.com
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: Spring Action Instantiation

Posted by st...@gmail.com.
Oooop!  The struts.xml change did not force the context to reload!  Now that
I have changed the class in the action mapping to the fully qualified class
name, it *is* being instantiated on each request!  So why is it not working
with the Spring bean id?

On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
>
> I replaced the spring bean id in my action mapping with the fully
> qualified class name to rule Spring out completely.  I am still never seeing
> the log4j output in the constructor of my action class!  I have double
> checked my log4j.properties and the debug output would be written out if
> the constructor were called.
>
> Any ideas?  Could this have anything to do with an interceptor?
>
> On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> >
> > I'm using Spring 2.x and the attribute scope="prototype"
> >
> > On 6/19/07, Zarar Siddiqi < zarars@gmail.com > wrote:
> > >
> > >
> > > It sounds to me like your Action class might be configured as a
> > > singleton.
> > > If that's the case the action class' constructor would only be called
> > > once
> > > on startup.  Make sure you have singleton="false" in your Spring
> > > config for
> > > the action class.  The default value for singleton is true.
> > >
> > >
> > >
> > > stanlick wrote:
> > > >
> > > > It appears as though I am not getting a new Action instance created
> > > for
> > > > each
> > > > request!  I have placed a logging statement in the constructor of my
> > > > Action
> > > > class and it is not emitting output.  The Bean inside the Action
> > > *is*
> > > > emitting log statements from its constructor so I must have the
> > > Spring
> > > > beans
> > > > wired correctly.  I am injecting both the Actions and Action Beans
> > > via
> > > > Spring.  I have scope=prototype on them both.
> > > >
> > > > Any ideas?
> > > >
> > > > Thanks,
> > > > Scott
> > > >
> > > >
> > >
> > > --
> > > View this message in context:
> > > http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> > > Sent from the Struts - User mailing list archive at Nabble.com.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Scott
> > stanlick@gmail.com
>
>
>
>
> --
> Scott
> stanlick@gmail.com




-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by Roger Varley <ro...@googlemail.com>.
On 20/06/07, Dave Newton <ne...@yahoo.com> wrote:
> ?!
>

I didn't understand a word of that either :-)

> --- Martin Gainty <mg...@hotmail.com> wrote:
>
> > Assuming Spring is your AOP framework
> > Logging is now an Advised entity
> > to be injected at compile time or runtime via
> > 'pointcut'
> > details on implementation are located here
> > http://www.devx.com/Java/Article/30799/0/page/1
> >
> > to quote
> > 'Because this FactoryBean concept is how Spring
> > wraps beans and then creates
> > a proxy for the bean (using some internal tool such
> > as dynamic proxies,
> > CGLIB, etc.) that executes some advice on method
> > calls when the pointcut
> > says the method is a joinpoint (assuming a pointcut
> > is defined). '
> >
> > M--
> > This email message and any files transmitted with it
> > contain confidential
> > information intended only for the person(s) to whom
> > this email message is
> > addressed.  If you have received this email message
> > in error, please notify
> > the sender immediately by telephone or email and
> > destroy the original
> > message without making a copy.  Thank you.
> >
> > ----- Original Message -----
> > From: <st...@gmail.com>
> > To: "Struts Users Mailing List"
> > <us...@struts.apache.org>
> > Sent: Wednesday, June 20, 2007 9:45 AM
> > Subject: Re: Spring Action Instantiation
> >
> >
> > >I replaced the spring bean id in my action mapping
> > with the fully qualified
> > > class name to rule Spring out completely.  I am
> > still never seeing the
> > > log4j
> > > output in the constructor of my action class!  I
> > have double checked my
> > > log4j.properties and the debug output would be
> > written out if the
> > > constructor were called.
> > >
> > > Any ideas?  Could this have anything to do with an
> > interceptor?
> > >
> > > On 6/20/07, stanlick@gmail.com
> > <st...@gmail.com> wrote:
> > >>
> > >> I'm using Spring 2.x and the attribute
> > scope="prototype"
> > >>
> > >> On 6/19/07, Zarar Siddiqi <zarars@gmail.com >
> > wrote:
> > >> >
> > >> >
> > >> > It sounds to me like your Action class might be
> > configured as a
> > >> > singleton.
> > >> > If that's the case the action class'
> > constructor would only be called
> > >> > once
> > >> > on startup.  Make sure you have
> > singleton="false" in your Spring config
> > >> > for
> > >> > the action class.  The default value for
> > singleton is true.
> > >> >
> > >> >
> > >> >
> > >> > stanlick wrote:
> > >> > >
> > >> > > It appears as though I am not getting a new
> > Action instance created
> > >> > for
> > >> > > each
> > >> > > request!  I have placed a logging statement
> > in the constructor of my
> > >> > > Action
> > >> > > class and it is not emitting output.  The
> > Bean inside the Action *is*
> > >> > > emitting log statements from its constructor
> > so I must have the
> > >> > > Spring
> > >> > > beans
> > >> > > wired correctly.  I am injecting both the
> > Actions and Action Beans
> > >> > > via
> > >> >
> > >> > > Spring.  I have scope=prototype on them both.
> > >> > >
> > >> > > Any ideas?
> > >> > >
> > >> > > Thanks,
> > >> > > Scott
> > >> > >
> > >> > >
> > >> >
> > >> > --
> > >> > View this message in context:
> > >> >
> >
> http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> > >> > Sent from the Struts - User mailing list
> > archive at Nabble.com.
> > >> >
> > >> >
> > >> >
> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > >> > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> Scott
> > >> stanlick@gmail.com
> > >
> > >
> > >
> > >
> > > --
> > > Scott
> > > stanlick@gmail.com
> > >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
>
>
> ____________________________________________________________________________________
> Sick sense of humor? Visit Yahoo! TV's
> Comedy with an Edge to see what's on, when.
> http://tv.yahoo.com/collections/222
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: Spring Action Instantiation

Posted by st...@gmail.com.
Spring is my IOC container.  So are you suggesting Spring is *not*
instantiating action classes on each request?  I am confused that it would
be creating the beans used by the actions on each invocation but not the
action itself.  Also, I am not sure how Spring could advise which methods to
call on a "dirty" action class without *some* advice from me!

On 6/20/07, Martin Gainty <mg...@hotmail.com> wrote:
>
> Assuming Spring is your AOP framework
> Logging is now an Advised entity
> to be injected at compile time or runtime via 'pointcut'
> details on implementation are located here
> http://www.devx.com/Java/Article/30799/0/page/1
>
> to quote
> 'Because this FactoryBean concept is how Spring wraps beans and then
> creates
> a proxy for the bean (using some internal tool such as dynamic proxies,
> CGLIB, etc.) that executes some advice on method calls when the pointcut
> says the method is a joinpoint (assuming a pointcut is defined). '
>
> M--
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
> ----- Original Message -----
> From: <st...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Wednesday, June 20, 2007 9:45 AM
> Subject: Re: Spring Action Instantiation
>
>
> >I replaced the spring bean id in my action mapping with the fully
> qualified
> > class name to rule Spring out completely.  I am still never seeing the
> > log4j
> > output in the constructor of my action class!  I have double checked my
> > log4j.properties and the debug output would be written out if the
> > constructor were called.
> >
> > Any ideas?  Could this have anything to do with an interceptor?
> >
> > On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
> >>
> >> I'm using Spring 2.x and the attribute scope="prototype"
> >>
> >> On 6/19/07, Zarar Siddiqi <zarars@gmail.com > wrote:
> >> >
> >> >
> >> > It sounds to me like your Action class might be configured as a
> >> > singleton.
> >> > If that's the case the action class' constructor would only be called
> >> > once
> >> > on startup.  Make sure you have singleton="false" in your Spring
> config
> >> > for
> >> > the action class.  The default value for singleton is true.
> >> >
> >> >
> >> >
> >> > stanlick wrote:
> >> > >
> >> > > It appears as though I am not getting a new Action instance created
> >> > for
> >> > > each
> >> > > request!  I have placed a logging statement in the constructor of
> my
> >> > > Action
> >> > > class and it is not emitting output.  The Bean inside the Action
> *is*
> >> > > emitting log statements from its constructor so I must have the
> >> > > Spring
> >> > > beans
> >> > > wired correctly.  I am injecting both the Actions and Action Beans
> >> > > via
> >> >
> >> > > Spring.  I have scope=prototype on them both.
> >> > >
> >> > > Any ideas?
> >> > >
> >> > > Thanks,
> >> > > Scott
> >> > >
> >> > >
> >> >
> >> > --
> >> > View this message in context:
> >> >
> http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> >> > Sent from the Struts - User mailing list archive at Nabble.com.
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >> >
> >>
> >>
> >> --
> >> Scott
> >> stanlick@gmail.com
> >
> >
> >
> >
> > --
> > Scott
> > stanlick@gmail.com
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by Dave Newton <ne...@yahoo.com>.
?!

--- Martin Gainty <mg...@hotmail.com> wrote:

> Assuming Spring is your AOP framework
> Logging is now an Advised entity
> to be injected at compile time or runtime via
> 'pointcut'
> details on implementation are located here
> http://www.devx.com/Java/Article/30799/0/page/1
> 
> to quote
> 'Because this FactoryBean concept is how Spring
> wraps beans and then creates 
> a proxy for the bean (using some internal tool such
> as dynamic proxies, 
> CGLIB, etc.) that executes some advice on method
> calls when the pointcut 
> says the method is a joinpoint (assuming a pointcut
> is defined). '
> 
> M--
> This email message and any files transmitted with it
> contain confidential
> information intended only for the person(s) to whom
> this email message is
> addressed.  If you have received this email message
> in error, please notify
> the sender immediately by telephone or email and
> destroy the original
> message without making a copy.  Thank you.
> 
> ----- Original Message ----- 
> From: <st...@gmail.com>
> To: "Struts Users Mailing List"
> <us...@struts.apache.org>
> Sent: Wednesday, June 20, 2007 9:45 AM
> Subject: Re: Spring Action Instantiation
> 
> 
> >I replaced the spring bean id in my action mapping
> with the fully qualified
> > class name to rule Spring out completely.  I am
> still never seeing the 
> > log4j
> > output in the constructor of my action class!  I
> have double checked my
> > log4j.properties and the debug output would be
> written out if the
> > constructor were called.
> >
> > Any ideas?  Could this have anything to do with an
> interceptor?
> >
> > On 6/20/07, stanlick@gmail.com
> <st...@gmail.com> wrote:
> >>
> >> I'm using Spring 2.x and the attribute
> scope="prototype"
> >>
> >> On 6/19/07, Zarar Siddiqi <zarars@gmail.com >
> wrote:
> >> >
> >> >
> >> > It sounds to me like your Action class might be
> configured as a
> >> > singleton.
> >> > If that's the case the action class'
> constructor would only be called
> >> > once
> >> > on startup.  Make sure you have
> singleton="false" in your Spring config
> >> > for
> >> > the action class.  The default value for
> singleton is true.
> >> >
> >> >
> >> >
> >> > stanlick wrote:
> >> > >
> >> > > It appears as though I am not getting a new
> Action instance created
> >> > for
> >> > > each
> >> > > request!  I have placed a logging statement
> in the constructor of my
> >> > > Action
> >> > > class and it is not emitting output.  The
> Bean inside the Action *is*
> >> > > emitting log statements from its constructor
> so I must have the 
> >> > > Spring
> >> > > beans
> >> > > wired correctly.  I am injecting both the
> Actions and Action Beans 
> >> > > via
> >> >
> >> > > Spring.  I have scope=prototype on them both.
> >> > >
> >> > > Any ideas?
> >> > >
> >> > > Thanks,
> >> > > Scott
> >> > >
> >> > >
> >> >
> >> > --
> >> > View this message in context:
> >> >
>
http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> >> > Sent from the Struts - User mailing list
> archive at Nabble.com.
> >> >
> >> >
> >> >
>
---------------------------------------------------------------------
> >> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail:
> user-help@struts.apache.org
> >> >
> >> >
> >>
> >>
> >> --
> >> Scott
> >> stanlick@gmail.com
> >
> >
> >
> >
> > -- 
> > Scott
> > stanlick@gmail.com
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

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


Re: Spring Action Instantiation

Posted by Martin Gainty <mg...@hotmail.com>.
Assuming Spring is your AOP framework
Logging is now an Advised entity
to be injected at compile time or runtime via 'pointcut'
details on implementation are located here
http://www.devx.com/Java/Article/30799/0/page/1

to quote
'Because this FactoryBean concept is how Spring wraps beans and then creates 
a proxy for the bean (using some internal tool such as dynamic proxies, 
CGLIB, etc.) that executes some advice on method calls when the pointcut 
says the method is a joinpoint (assuming a pointcut is defined). '

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <st...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, June 20, 2007 9:45 AM
Subject: Re: Spring Action Instantiation


>I replaced the spring bean id in my action mapping with the fully qualified
> class name to rule Spring out completely.  I am still never seeing the 
> log4j
> output in the constructor of my action class!  I have double checked my
> log4j.properties and the debug output would be written out if the
> constructor were called.
>
> Any ideas?  Could this have anything to do with an interceptor?
>
> On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
>>
>> I'm using Spring 2.x and the attribute scope="prototype"
>>
>> On 6/19/07, Zarar Siddiqi <zarars@gmail.com > wrote:
>> >
>> >
>> > It sounds to me like your Action class might be configured as a
>> > singleton.
>> > If that's the case the action class' constructor would only be called
>> > once
>> > on startup.  Make sure you have singleton="false" in your Spring config
>> > for
>> > the action class.  The default value for singleton is true.
>> >
>> >
>> >
>> > stanlick wrote:
>> > >
>> > > It appears as though I am not getting a new Action instance created
>> > for
>> > > each
>> > > request!  I have placed a logging statement in the constructor of my
>> > > Action
>> > > class and it is not emitting output.  The Bean inside the Action *is*
>> > > emitting log statements from its constructor so I must have the 
>> > > Spring
>> > > beans
>> > > wired correctly.  I am injecting both the Actions and Action Beans 
>> > > via
>> >
>> > > Spring.  I have scope=prototype on them both.
>> > >
>> > > Any ideas?
>> > >
>> > > Thanks,
>> > > Scott
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> > http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
>> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>>
>> --
>> Scott
>> stanlick@gmail.com
>
>
>
>
> -- 
> Scott
> stanlick@gmail.com
> 


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


Re: Spring Action Instantiation

Posted by st...@gmail.com.
I replaced the spring bean id in my action mapping with the fully qualified
class name to rule Spring out completely.  I am still never seeing the log4j
output in the constructor of my action class!  I have double checked my
log4j.properties and the debug output would be written out if the
constructor were called.

Any ideas?  Could this have anything to do with an interceptor?

On 6/20/07, stanlick@gmail.com <st...@gmail.com> wrote:
>
> I'm using Spring 2.x and the attribute scope="prototype"
>
> On 6/19/07, Zarar Siddiqi <zarars@gmail.com > wrote:
> >
> >
> > It sounds to me like your Action class might be configured as a
> > singleton.
> > If that's the case the action class' constructor would only be called
> > once
> > on startup.  Make sure you have singleton="false" in your Spring config
> > for
> > the action class.  The default value for singleton is true.
> >
> >
> >
> > stanlick wrote:
> > >
> > > It appears as though I am not getting a new Action instance created
> > for
> > > each
> > > request!  I have placed a logging statement in the constructor of my
> > > Action
> > > class and it is not emitting output.  The Bean inside the Action *is*
> > > emitting log statements from its constructor so I must have the Spring
> > > beans
> > > wired correctly.  I am injecting both the Actions and Action Beans via
> >
> > > Spring.  I have scope=prototype on them both.
> > >
> > > Any ideas?
> > >
> > > Thanks,
> > > Scott
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Scott
> stanlick@gmail.com




-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by st...@gmail.com.
I'm using Spring 2.x and the attribute scope="prototype"

On 6/19/07, Zarar Siddiqi <za...@gmail.com> wrote:
>
>
> It sounds to me like your Action class might be configured as a singleton.
> If that's the case the action class' constructor would only be called once
> on startup.  Make sure you have singleton="false" in your Spring config
> for
> the action class.  The default value for singleton is true.
>
>
>
> stanlick wrote:
> >
> > It appears as though I am not getting a new Action instance created for
> > each
> > request!  I have placed a logging statement in the constructor of my
> > Action
> > class and it is not emitting output.  The Bean inside the Action *is*
> > emitting log statements from its constructor so I must have the Spring
> > beans
> > wired correctly.  I am injecting both the Actions and Action Beans via
> > Spring.  I have scope=prototype on them both.
> >
> > Any ideas?
> >
> > Thanks,
> > Scott
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by Zarar Siddiqi <za...@gmail.com>.
It sounds to me like your Action class might be configured as a singleton. 
If that's the case the action class' constructor would only be called once
on startup.  Make sure you have singleton="false" in your Spring config for
the action class.  The default value for singleton is true.



stanlick wrote:
> 
> It appears as though I am not getting a new Action instance created for
> each
> request!  I have placed a logging statement in the constructor of my
> Action
> class and it is not emitting output.  The Bean inside the Action *is*
> emitting log statements from its constructor so I must have the Spring
> beans
> wired correctly.  I am injecting both the Actions and Action Beans via
> Spring.  I have scope=prototype on them both.
> 
> Any ideas?
> 
> Thanks,
> Scott
> 
> 

-- 
View this message in context: http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Spring Action Instantiation

Posted by st...@gmail.com.
I'm using the spring id only.

On 6/19/07, Adam Ruggles <a....@gmail.com> wrote:
>
> Are you specifying the entire class name in the action mapping
> definition instead of using the spring bean id?
>
> stanlick@gmail.com wrote:
> > It appears as though I am not getting a new Action instance created
> > for each
> > request!  I have placed a logging statement in the constructor of my
> > Action
> > class and it is not emitting output.  The Bean inside the Action *is*
> > emitting log statements from its constructor so I must have the Spring
> > beans
> > wired correctly.  I am injecting both the Actions and Action Beans via
> > Spring.  I have scope=prototype on them both.
> >
> > Any ideas?
> >
> > Thanks,
> > Scott
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Scott
stanlick@gmail.com

Re: Spring Action Instantiation

Posted by Adam Ruggles <a....@gmail.com>.
Are you specifying the entire class name in the action mapping 
definition instead of using the spring bean id?

stanlick@gmail.com wrote:
> It appears as though I am not getting a new Action instance created 
> for each
> request!  I have placed a logging statement in the constructor of my 
> Action
> class and it is not emitting output.  The Bean inside the Action *is*
> emitting log statements from its constructor so I must have the Spring 
> beans
> wired correctly.  I am injecting both the Actions and Action Beans via
> Spring.  I have scope=prototype on them both.
>
> Any ideas?
>
> Thanks,
> Scott
>

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


Spring Action Instantiation

Posted by st...@gmail.com.
It appears as though I am not getting a new Action instance created for each
request!  I have placed a logging statement in the constructor of my Action
class and it is not emitting output.  The Bean inside the Action *is*
emitting log statements from its constructor so I must have the Spring beans
wired correctly.  I am injecting both the Actions and Action Beans via
Spring.  I have scope=prototype on them both.

Any ideas?

Thanks,
Scott