tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: InitParameters missing in ServletConfig when Servlet-loading triggerd through Re
Date Sat, 18 May 2002 17:27:10 GMT
Servlet initialization parameters are only visible to servlets that are
mapped directly in a <servlet-mapping>.  If you access a servlet
indirectly via the invoker (i.e. "/servlet/*"), you are *not* going to see
these parameters.

Craig


On Thu, 16 May 2002, Karl Leipzig wrote:

> Date: Thu, 16 May 2002 11:52:54 +0000
> From: Karl Leipzig <karl_leipzig@hotmail.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: InitParameters missing in ServletConfig when Servlet-loading
>     triggerd through Re
>
> Hello,
> using Tomcat 4.0.3 (and 4.0.2 also) I encounter the following problem:
>
> Problem setup:
> My servlet has no <load-on-startup/> set.
>
> I start Tomcat.
> I trigger the loading of servlet A through a RequestDispatchers forward as
> quoted below.
> I trace my servlet A's ServletConfig init-parameters in the init() method
> call.
> The newly loaded servlet A's ServletConfig DOES NOT contain the
> init-parameters I specifed in web.xml!
>
> Unsatisfying solution setup:
> This time I specify a <load-on-startup>1</load-on-startup> in web.xml:
>
> I start Tomcat.
> The loading of servlet A is triggerd through the container on startup.
> I trace my servlet A's ServletConfig init-parameters in the init() method
> call.
> The newly loaded servlet A's ServletConfig as expected DOES contain all
> init-parameters I specifed in web.xml.
>
> Why are my init-parameters missing in the first case?
>
> Thank you,
> Philipp.
>
>
> Code used for forwarding:
> RequestDispatcher requestDispatcher =
> getServletContext().getRequestDispatcher("/servlet/" +
> responsibleServletName);
> requestDispatcher.forward(servletRequest, servletResponse);
>
>
> _________________________________________________________________
> Werden Sie Mitglied bei MSN Hotmail, dem größten E-Mail-Service der Welt.
> http://www.hotmail.com
>
>
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message