I don't understand why you are unable to create ServletContext ctx = getServlet().getServletContext(); will not work?  are you using struts or a vanilla Servlet?; not that, that is of any use, but it should work.

Cheers,

Kristen.
--
Kristen Gillard
Multitask Consulting Pty Ltd
Lvl 8, 20 Loftus Street,
Circular Quay, NSW, 2000
--
Ph:   61-2-9252-1462
Fx:   61-2-9252-4636
Mo:  0409-000-123
--
http://www.multitask.com.au/



"Rick Reumann" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

27/05/2003 01:36 PM

Please respond to
[EMAIL PROTECTED]

To
[EMAIL PROTECTED]
cc
Subject
Re: [MVC-Programmers] Re: Is this an 'ok' way to setup commonly used collections??





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

_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.basebeans.net:8080/mailman/listinfo/mvc-programmers

Reply via email to