File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[UserDispatchAction] retrieve attribute from servlet context

Alessandro Ilardo
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

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

Thanks in advance
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic