• 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

scope of the request

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i am new to struts .can any one explain why should the scope of the request in struts should be only in request or session . why not in others like application.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since application scope applies to all users of the web application, it wouldn't make any sense at all to put an ActionForm in Application scope, since an ActionForm represents one user's interaction with the application. The only scopes that make sense are request, which spans only a single request to the server, or session, which spans multiple requests from the same user.

If there are portions of the ActionForm that do apply to all users, it's a good idea to separate those out and put them in Application scope rather than in the form bean. For example, suppose you have a select box that allows the users to select one of the 50 US States. Since that list of States doesn't change from one user to the next, you could put only this list in Application scope and leave the rest of the ActionForm in request or session scope.
 
sunny mak
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Higginson . I am clear now.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic