• 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 to get ServletContext from ActionMapping

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

Call the execute method of this action class, passing on a reference to the mapping that was used (thereby providing access to the underlying ActionServlet and ServletContext, as well as any specialized properties of the mapping itself), and the request and response...



----------------------------------------

also from javadoc:

The action classes will manipulate the state of the application's interaction with the user, typically by creating or modifying JavaBeans that are stored as request or session attributes (depending on how long they need to be available). Such JavaBeans represent the "model" component of an MVC architecture.



is not a good approach set javabean as application attribute once, instead set to each new session?

thanks in advance..
[ December 10, 2006: Message edited by: Alexandre Lima ]
 
Author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's always best to conserve resources and use the "highest level" context that makes sense. In some cases, beans may contain properties that pertain only to the instant client and therefore belong in session scope. Other beans may contain data (or more likely access utilities) that all clients can share, and can be safely placed in application scope.
ActionForm beans are usually best kept in request scope since this limits potential side effects. But for some workflow use-cases, keeping an ActionForm in session scope makes sense.
HTH, Ted.
 
no more user
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Ted,

thanks for response!!

but only clear this point please, for better understanding..

Originally posted by Ted Husted:
ActionForm beans are usually best kept in request scope since this limits potential side effects.



what are potencial side effects
[ December 10, 2006: Message edited by: Alexandre Lima ]
reply
    Bookmark Topic Watch Topic
  • New Topic