Re: Re: Is this an 'ok' way to setup commonly used collections??
[email protected] Fri, 23 May 2003 14:59:18 +1000
| Newsgroups | gmane.comp.java.mvc.devel |
|---|---|
| Message-ID | <OFA7A6E4AE.349A17DB-ONCA256D2F.001B3652-CA256D2F.001B1D35@multitask.com.au> |
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. 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] 12/05/2003 02:44 PM Please respond to [email protected] To [email protected] cc Subject [MVC-Programmers] Re: Is this an 'ok' way to setup commonly used collections?? On Mon, 12 May 2003 00:14:55 -0400, Rick Reumann wrote: > The SetupServlet looks like this: > > public class SetupServlet extends HttpServlet { > rotected static Log log = LogFactory.getLog(SetupServlet.class); > > private ServletContext servletContext = getServletContext(); The above doesn't work when I set this servletContext as a class member variable. Somehow my servlet's init doesn't called when I declare it like above. I removed the above and just got the servletContext locally inside my SetupServlet init() and destroy() methods and all is well. Not sure of exactly why that prevented my init method from getting called on server start up. I haven't looked into it yet, but if anyone knows why let me know. thanks. -- Rick _______________________________________________ MVC-Programmers mailing list [email protected] http://www.basebeans.net:8080/mailman/listinfo/mvc-programmers