Three things you can do (that I can think of):

1. Write a servlet that's also a JavaBean.  Then you'd have access to the
ServletConfig and ServletContext.

2. Read the properties from a standard Java properties file.  This would be
faster than doing XML parsing.

3. Get the ServletContext and Config params in a servlet or JSP and then set
them in your bean.  They're just Strings, so it'd be standard
accessor/mutator methods. You could even use the JSP standard bean tags, set
the bean to application scope, and get the params out of the implicit
"application" object.  Why not?  That's what they're for.  

I think 1 & 3 are the way most people do things.

Scott

Scott Stirling
Allaire Corporation
http://www.allaire.com/developer/jrunreferencedesk/

> -----Original Message-----
> From: Gaurav Gehlot [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 08, 2000 6:55 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Reading Context Params from web.xml
> 
> 
> Hi,
>   Actually what I am trying to do here is that I want to set 
> the application
> init parameters thru the JMC and then read them in my bean 
> class.This bean
> class doesnt have any ServletContext or ServletConfigObject 
> availbale to
> it.So I cant use the normal ServletContext.getInitParameter() method.
> So I was thinking that if there is any other way provided by JRun to
> programatically read the web.xml file.
> 
> gg
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the 
body.

Reply via email to