• 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

a few interview questions

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

1)What's a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization? Should I use the SingleThreadModel interface or provide explicit synchronization to make my JSP pages and servlets thread safe?

2) Is there a way I can set my servlets to do thread pooling? Can I spawn a background thread from my servlet?
3) When building web applications, what are some areas where synchronization problems arrise?
Rgrds
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Synchronisation is better as implementing SingleThreadModel is not fully thread safe.(Multiple threads can still access static variables)
SingleThreadModel is deprecated in Servlet2.4 spec and you are suggested to stop using this interface.
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
3)
a. Class variable
b. instance variable
c. session data
d. application data
 
reply
    Bookmark Topic Watch Topic
  • New Topic