wood burning stoves 2.0*
The moose likes Servlets and the fly likes Regarding configuration parameters problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Regarding configuration parameters problem" Watch "Regarding configuration parameters problem" New topic
Author

Regarding configuration parameters problem

siddu banjapally
Greenhorn

Joined: Aug 16, 2011
Posts: 13

How to change the configuration variables in the runtime without using web.xml.



thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

What configuration variables?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
siddu banjapally
Greenhorn

Joined: Aug 16, 2011
Posts: 13

Means,Servlet config values [init-param param name, param value] in web.xml file..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

For what purpose?
siddu banjapally
Greenhorn

Joined: Aug 16, 2011
Posts: 13

assume, If my Servlet config parameters contains oracle related Connection Values. I would like to Change to MySql.. So I need to Change those Values In web.xml..


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

At run-time? Why?
siddu banjapally
Greenhorn

Joined: Aug 16, 2011
Posts: 13

Actually.. I got this question in a INTERVIEW.

He asked me how can change the parameter values in web.xml at run-time, without editing the web.xml.

I thought there is no way like to solve this problem.. Finally I came here to know by JavaRanch.

If you know related answer, please post .

bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
siddu banjapally wrote:He asked me how can change the parameter values in web.xml at run-time, without editing the web.xml.

As far as I know you cannot change the values without modifying the web.xml directly.
I don't know how good this is, But I remember reading a get around for this some time back in stackoverflow.com. Store the parameter as context attribute and use this context attribute instead of directly using the parameter. This way you will get to change the value. I am again stressing that I don't know how good or correct this method is.

Bear, need your inputs here
siddu banjapally
Greenhorn

Joined: Aug 16, 2011
Posts: 13

Thanks Bhanu for your reply.If you get any more idea related this please post.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Please let us know when you are asking a question posed in an interview. Such questions usually make little sense and there will be a lot less confusion if we know it's an interview question.


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Regarding configuration parameters problem