This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes [UserDispatchAction] retrieve attribute from servlet context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[UserDispatchAction] retrieve attribute from servlet context" Watch "[UserDispatchAction] retrieve attribute from servlet context" New topic
Author

[UserDispatchAction] retrieve attribute from servlet context

Alessandro Ilardo
Ranch Hand

Joined: Dec 23, 2005
Posts: 218
Hi there,
on a plugIn class I store a properties object in the servlet context, like this:
ServletContext context = servlet.getServletContext();
context.setAttribute(Constants.ROLES, roles);

the question is, why if I try to retrieve that object in this way from a DispatchAction, I get a null object
private Properties props = (Properties)servlet.getServletContext().getAttribute(Constants.ROLES);

while inside the method, like this, it works fine?
Properties roles = (Properties)request.getSession(false).
getServletContext().getAttribute(Constants.ROLES);

Can you tell me if this way will strongly affect the performance?

Thanks in advance


trying to decode a woman mind....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [UserDispatchAction] retrieve attribute from servlet context
 
Similar Threads
Doubts
Difference between getAttribute and getParameter
DispatchAction No action instance for path ...
Struts framework question.. thanks..
Servelet Context