Mr.Chowdary
Mr.Chowdary

Reputation: 3407

will different action objects created in struts2 for different methods called of same action?

I have an Action class with 3 methods. I know that for every request to Action class it will create an instance. But here I'm requesting the same Action class with different method.

How many objects will be created? 3, or only 1 ?

How can I find out?

Upvotes: 3

Views: 1088

Answers (1)

Uchenna Nwanyanwu
Uchenna Nwanyanwu

Reputation: 3204

Creation of your action instances does not depend on the number of methods that you have in your action class. It solely depends on the number of request that you make. So if you make n requests, n instances are created. And i believe the instance is destroyed once the action class instance is done serving the request.

Upvotes: 5

Related Questions