It turned out to be an issue with my Cactus TestCase.  See solution marked
<<-- below

    protected void setUp() throws Exception {
        super.setUp();
        servlet = new RegistrationServlet();
        servlet.init(config); <<-- Adding this fixed the problem.
    }

Thanks for kicking my brain into gear.

Matt

-----Original Message-----
From: Raible, Matt 
Sent: Friday, May 30, 2003 12:55 PM
To: 'Struts Users Mailing List'
Subject: RE: NPE with getResourceAsStream


I'm doing this in an execute(request,response) method that both doGet() and
doPost() call.

-----Original Message-----
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Friday, May 30, 2003 12:39 PM
To: Struts Users Mailing List
Subject: Re: NPE with getResourceAsStream


Are you doing this in the constructor or an overridden init(ServletConfig)
that
hasn't invoked super.init(config)?

Quoting "Raible, Matt" <[EMAIL PROTECTED]>:

> In a regular servlet, I'm trying to do the following:
> 
>         InputStream forms =
>  
> getServletContext().getResourceAsStream("/WEB-INF/validation.xml");
> 
> But it's throwing a NPE, and validation.xml is in my WEB-INF folder.  Any
> ideas why this may be happening?
> 
> Thanks,
> 
> Matt
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to