Questions tagged [init-parameters]
25 questions
47
votes
3 answers
cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'
This is my web.xml xsd

michael nesterenko
- 14,222
- 25
- 114
- 182
29
votes
2 answers
Getting the init parameters in a servlet
I am new to servlets. I got the init parameters in DD within the init() method using getInitParameter("name"). I tried a lot from within doGet() method to access the init parameters, but it always returns null.
I tried with…

Shameer
- 351
- 2
- 5
- 11
27
votes
2 answers
Difference b/w and
DD elements and both can be retrieved by the getInitParameter() method, in the servlet code.
Now the question is, how does it differentiate and ?

giri
- 26,773
- 63
- 143
- 176
7
votes
1 answer
Common init-parameters in web.xml for multiple java servlets?
My current understanding is that init-params in the web.xml must be put in the body of a servlet variable, like this:
MyServlet
MyServlet
…

Bobby Pardridge
- 267
- 6
- 16
5
votes
3 answers
@WebServlet with init parameters from xml
I am checking new annotations for web servlets but what I do not understand how can you pass initial parameters (init-param) from easily modified location. Yes, I found annotation @WebInitParam, but that means you must write value into code, which i…

JIV
- 813
- 2
- 12
- 30
4
votes
1 answer
Get servlet init params in servlet context listener

Daulet Nurgali
- 167
- 1
- 3
- 8
4
votes
2 answers
Get filter init parameters in a servlet
I have a filter that looks like this:
TestFilter
org.TestFilter
timeout
30
…

JeffJak
- 2,008
- 5
- 28
- 40
3
votes
3 answers
How to retrieve value from web.xml in Servlet?
I need to retrieve init-param value from xml to Servlet i used following code
LoginServlet
LoginServlet
jdbcDriver
…

Anand
- 339
- 4
- 5
- 16
3
votes
2 answers
Getting null while accessing initParameter in jsp
I am trying to access initParameter in my jsp.
When I try to access the initparameter it is coming out as null.
My jsp page is:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

RockAndRoll
- 2,247
- 2
- 16
- 35
3
votes
3 answers
how to get init param of portlet.xml in liferay?
i am using custom porltet in my liferay portal 6.i have some global variable that i want to use through out my portlet classes so for that i have written that variable in portlet.xml file as follows..
Host
…

BhavikKama
- 8,566
- 12
- 94
- 164
2
votes
0 answers
Set @WebInitParam dynamic value
This is my code. I am trying to set the Init parameters dynamically. Currently java accepts only a String as the param. I need something like value = getValues(). The idea is to set the config value dynamically.
@WebServlet(value = "/dwr/*",…

karthik raghupathy
- 21
- 1
1
vote
0 answers
How to Reference Web.xml's Context Param Inside Web.xml Itself?
Assume that there is a context parameter defined inside web deployment descriptor:
initParam
initParamValue
How can I use this parameter inside…

NuCradle
- 665
- 1
- 9
- 31
1
vote
0 answers
Use environment specific variable as dynamic init param of servlet filters
I have some external library Filters I want to include in my Java/Spring webapp. So I don't have access to change the source of the Filters themselves. The Filters have configurable options based on the FilterConfig. Normally these can be set in the…

ryber
- 4,537
- 2
- 26
- 50
1
vote
2 answers
How to acces other servlet's init-parameters or context's contex-parameters inside quartz jobs?
I have defined my quartz job with the XML jobs configuration as in here example 2
http://www.mkyong.com/java/example-to-run-multiple-jobs-in-quartz/
I have other servlets wich have some init-params and my web app also has some context-params.
How…
user494461
1
vote
1 answer
Using annotations to define multiple servlets of the same class with different init-params
I have previously achieved this by using web.xml like so:
Test1
com.abc.test.Servlet
propertyKey
…

James
- 195
- 3
- 11