You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jason Lanpher <jl...@stealthnetworking.com> on 2003/09/09 23:31:39 UTC

Getting Values from a web.xml file.

Hi everyone,

	
	I was wondering if anyone could provide me with a simple code
example to allow me to get a value from my web.xml file.  I want to get the
value from the following example web.xml file.

	<context-param>
		<param-name>num</param-name>
		<param-value>50</param-value>
	</context-param>

I want to get the value in a java bean.  I am just a little confused on how
to get this value out of my web.xml file.

Any help would be greatly appreciated.

Jason Lanpher
 
jlanpher@stealthnetworking.com
 
http://www.stealthnetworking.com
 

Remember there are only 10 types of people in this world.  Those who
understand Binary and those who don't.

 


-----Original Message-----
From: Kal Govindu [mailto:Kalg@waterfield.com] 
Sent: Tuesday, September 09, 2003 7:57 AM
To: Tomcat Users List
Subject: RE: Good sites that show you EJB stuff


www.ejbtut.com
kal

-----Original Message-----
From: Anson Zeall [mailto:zeallous@bigpond.net.au]
Sent: Monday, September 08, 2003 6:49 AM
To: Tomcat Users List
Subject: Good sites that show you EJB stuff


Hi,

    I want to know if anyone, could show me, or recommend me any sites that
show you how to use JavaBeans and what the Beans are for?

Regards,


Anson







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



Re: Getting Values from a web.xml file.

Posted by Tim Funk <fu...@joedog.org>.
String value = servletContext.getInitParameter("num");

-Tim

Jason Lanpher wrote:

> Hi everyone,
> 
> 	
> 	I was wondering if anyone could provide me with a simple code
> example to allow me to get a value from my web.xml file.  I want to get the
> value from the following example web.xml file.
> 
> 	<context-param>
> 		<param-name>num</param-name>
> 		<param-value>50</param-value>
> 	</context-param>
> 
> I want to get the value in a java bean.  I am just a little confused on how
> to get this value out of my web.xml file.
> 
> Any help would be greatly appreciated.
> 
> Jason Lanpher