Object count in JVM for struts Action

M

Mukesh Gupta

Hello group,

I want to make a discussion on count of object formed in JVM for struts
action.

My question is: when we use action class to perform some action in
struts.
1. every call has its own action (different) object.
2. is every session has its own action (different) object.

As far as understand every call to the action has different object to
perform the task. But I observed through profiler that for different -2
calls there is only one action object in JVM. Even for different
session there is only one object formed.

Its confusing... please tell what is the actual scenario according to
struts framework.

If my observation is correct then in what all manner we can use this
one object nature of action object.

Thanks.
MG
 
W

Wendy Smoak

Mukesh Gupta said:
As far as understand every call to the action has different object to
perform the task. But I observed through profiler that for different -2
calls there is only one action object in JVM. Even for different
session there is only one object formed.

Its confusing... please tell what is the actual scenario according to
struts framework.

http://struts.apache.org/userGuide/building_controller.html#action_design_guide

"The controller servlet creates only one instance of your Action class, and
uses this one instance to service all requests. Thus, you need to write
thread-safe Action classes."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,122
Latest member
VinayKumarNevatia_
Top