• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding configuration parameters problem

 
siddu banjapally
Greenhorn
Posts: 13
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to change the configuration variables in the runtime without using web.xml.



thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What configuration variables?
 
siddu banjapally
Greenhorn
Posts: 13
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Means,Servlet config values [init-param param name, param value] in web.xml file..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For what purpose?
 
siddu banjapally
Greenhorn
Posts: 13
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At run-time? Why?
 
siddu banjapally
Greenhorn
Posts: 13
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bhanu for your reply.If you get any more idea related this please post.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic