• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How Action class instance will be created?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I came across one interview question.
Question was

How action class will handle each new request?
A) For each request controller will create new instance of action class.
B) Single instance will handle all request.
C) instance creation is configurable in Struts-config.xml file.
D) Multiple request will be handle by multiple instance.

My knowledge says ans should be "B" as we think about controller is just servlet and servelt will have one instance with multiple thread running.

Please give your comment.
Correct me if i am wrong.

Thank you in advance,
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bing! Bing! Bing! You are correct!!

I suppose that the real answer is "Single instance per JVM"...though if the question was for Struts 2.0 I believe that A would be the more correct answer.

- Brent
reply
    Bookmark Topic Watch Topic
  • New Topic