Re: Re: Is this an 'ok' way to setup commonly used collections??
[email protected] Wed, 28 May 2003 17:24:16 +1000
| Newsgroups | gmane.comp.java.mvc.devel |
|---|---|
| Message-ID | <OF5C5353C7.83FBA9CF-ONCA256D34.002026D3-CA256D34.0028634C@multitask.com.au> |
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