You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luke Vanderfluit <lu...@chipcity.com.au> on 2003/10/15 23:58:15 UTC

RequestDispatcher and getServletContext() don't work when using init()

Hi, 

I found that using the init() method to set up a database connection
then trying to instantiate a ServletContext object and forward to a jsp
page didn't work. 

If placed the database connection code in the doPost() then it DID,

The 2 code sets are attached,

can anyone tell me why?

thanks,
kind regards,
Luke

-- 
====================================
"when my computer smiles, I'm happy"
===============================.~ ~,
Luke Vanderfluit               |'/']
Mobile: 0421 276 282            \~/`

Re: RequestDispatcher and getServletContext() don't work when using init()

Posted by Tim Funk <fu...@joedog.org>.
You must call super.init(...) in your init method.

-Tim

Luke Vanderfluit wrote:
> Hi, 
> 
> I found that using the init() method to set up a database connection
> then trying to instantiate a ServletContext object and forward to a jsp
> page didn't work. 
> 
> If placed the database connection code in the doPost() then it DID,
> 
> The 2 code sets are attached,
> 
> can anyone tell me why?
> 
> thanks,
> kind regards,
> Luke
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org