Forums Register Login

Getting Null Value

+Pie Number of slices to send: Send
Hi there ,
When i try to get the initilization parameter in the servlet file , i am getting as null , i have defined in the deployment descriptor like this and i am using such code
ServletContext context = getServletContext();
String strParamValue = context.getInitParameter("FileName"); and in web.xml file it is like
<servlet>
<servlet-name>
<init-param>
<param-name>FileName</para-name>
<param-vlue>MyFile</param-value>
</init-param>
</servlet>
so cud u tell me why i am getting null values i shd get "MyFile " in the strParamValue i suppose ,and i tried by using this also
String strParamValue = getInitParameter("MyFile");
the same thing is happening here also so cud what cud the problem and how to get all those values.
thanks in advance
..gaurav
+Pie Number of slices to send: Send
if that is a cut and past of your code, this line makes the xml document not well formed:
<param-vlue>MyFile</param-value>
value is spelled "vlue"
+Pie Number of slices to send: Send
now i got it correctly , the problem being i was wrongly putting the context-param in the web.xml file ,when i put this one under <web-app</web-app> , its worked fine and earlier i was putting inside the <servlet></servlet> tag.
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 731 times.
Similar Threads
mapping all jsps to single servlets init parameters
Multiple Struts-config.xml in Jboss 4.2.1
Problem with Jsp Init parameter
Where i cud put contex-param
Servlet Init Parameter's
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:04:27.