Re: Re: Is this an 'ok' way to setup commonly used collections??

[email protected] Fri, 23 May 2003 15:46:15 +1000
Newsgroups gmane.comp.java.mvc.devel
Message-ID <OFD2CA4F43.B1E36B6F-ONCA256D2F.001FA6EC-CA256D2F.001F6965@multitask.com.au>
Sorry type-o!




[email protected] 
Sent by: [email protected]
23/05/2003 02:59 PM
Please respond to
[email protected]


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







You can get the servlet context by just using 
getServlet().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