Found the answer at the Java Forum:
http://forum.java.sun.com/thread.jsp?forum=33thread=482125
I think it's a case of RTFM here. I should have
understood that difference between ServletConfig and
ServletContext. Now I do. - MOD
__
Do you Yahoo!?
Yahoo!
Init parameters for a servlet are specified in
web.xml, using the init-param child of the servlet
tag.
These can be accessed using the
javax.servlet.GenericServlet.getInitParameter(). So
far, so good.
There's also a getInitParameter() method in the
javax.servlet.ServletContext class. I
It appears that the init params of the servlet and its
context are different. Can someone clear up this
misunderstanding for me?
Yes you are right.
There's also a getInitParameter() method in the
javax.servlet.ServletContext class. I thought it,
too, gave access to the init-param values.
Hi,
I'm experience something completely mysterious and I'm sure I'm doing
something wrong -- the question is what?.
I've set some init parameters in server.xml as follows:
Context ...
Parameter name=creditcard.store_id
value=xxx /
Parameter
Hi there,
I'm facing a strange problem sometimes when I'm doing an ant
undeploy/deploy:
Sometimes, the Context InitParameters don't get initialized, they simply
resume to null.
Does anybody have any idea what might cause this? It is reproducible but
happens at different times.
The problem
I can access my parameters if I put them in this
format.
Context Parameter ... //Contect
But if I use this format, which what I really want, I
can not access them using getInitParameter(name)
servlet
servlet-nametestbed/servlet-name
jsp-fileMail/testbed.jsp/jsp-file
init-param
(param-name) will get
you back param-value.
Yoav Shapira
Millennium ChemInformatics
-Original Message-
From: Luminous Heart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 2:03 PM
To: Tomcat Users List
Subject: How to get InitParameters.
I can access my parameters if I put them
param-value.
Yoav Shapira
Millennium ChemInformatics
-Original Message-
From: Luminous Heart
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 2:03 PM
To: Tomcat Users List
Subject: How to get InitParameters.
I can access my parameters if I put them in this
format
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
2002 11:52:54 +
From: Karl Leipzig [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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
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
]]
Sent: May 16, 2002 09:40
To: Tomcat Users List
Subject: InitParameters missing in ServletConfig when Servlet-loading
triggerd through RequestDispatcher
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
Hello!
I have some problems to read the init-parameters for my servlet.
I'm usign tomcat 3.2.3, mod-jk. But tested with tomcat standalone on
port 8080.
Here's my web.xml, located on TOMCAT_HOME/webapps/test/WEB-INF/
web-app
servlet
servlet-nameremoteServlet/servlet-name
I suggest you need to use your servlet-name to invoke your Servlet if you
want
to use your init-param, it will force your init-param to be included,
for example:
http://xxx.xxx.xxx.xxx:8080/myapp/servlet/remoteServlet
if you use your Servlet class name to invoke your Servlet, for example:
I have multiple servlets in the same directory and they all get the same
init-params from web.xml.
Currently, I have 5 servlets and am required to repeat all the init-params
5 times, one for each servlet. So if one parameter changes, I have to
change it five times in web.xml. I'd like to only
How about this:
Set up your init params for one of your servlets.
Make sure that this servlet get's pre-loaded first before the other
servlets.
Have the init() method of that servlet store all the parameters as
System properties and let the other servlets retrieve the parameters
as System
initParameters
How about this:
Set up your init params for one of your servlets.
Make sure that this servlet get's pre-loaded first before the other
servlets.
Have the init() method of that servlet store all the parameters as
System properties and let the other servlets retrieve
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 4:38 PM
To: [EMAIL PROTECTED]
Subject: Multiple servlets using same initParameters
I have multiple servlets in the same directory and they all get the same
init-params from web.xml.
Currently, I have 5 servlets and am
In web.xml:
context-param
param-nameopen-port/param-name
param-value7180/param-value
descriptionPort for regular HTTP via Apache/description
/context-param
context-param
param-namesecure-port/param-name
param-value7143/param-value
descriptionPort for HTTPS via Apache/description
19 matches
Mail list logo