Re: Re: Is this an 'ok' way to setup commonly used collections??
"Rick Reumann" <[email protected]> Mon, 26 May 2003 23:36:34 -0400
| Newsgroups | gmane.comp.java.mvc.devel |
|---|---|
| Organization | baseBeans Engineering |
| Message-ID | <[email protected]> |
On Fri, 23 May 2003 14:59:18 +1000, kriste wrote:
> You can get the servlet context by just using getServletContext() in your
> servlet... you shouldn't need to declare as a (private class variable) it
> as it is derived from the super class.
Right, I understand that. I just thought it was less overhead rather than
calling, over and over again in my servlet ...
getServletContext().setAttribute("someThing"), to first get the
HttpServletContext as a variable and then populate all the attributes ie:
ServletContext servletContext = getServletContext();
servletContext.setAttribute("itGroups", itGroups );
servletContext.setAttribute("projectPriorities", projectPriorities );
servletContext.setAttribute("projectStatus", projectStatus );
I guess I'm just being picky:) I'm sure calling
getServletContext() in each of the above cases isn't that big of a deal.
--
Rick