Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Regarding configuration parameters problem

 
Greenhorn
Posts: 13
Tomcat Server Chrome Java
  • 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
 
Marshal
Posts: 67413
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What configuration variables?
 
siddu banjapally
Greenhorn
Posts: 13
Tomcat Server Chrome Java
  • 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
Marshal
Posts: 67413
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For what purpose?
 
siddu banjapally
Greenhorn
Posts: 13
Tomcat Server Chrome Java
  • 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
Marshal
Posts: 67413
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At run-time? Why?
 
siddu banjapally
Greenhorn
Posts: 13
Tomcat Server Chrome Java
  • 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 .

 
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
Tomcat Server Chrome Java
  • 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
Marshal
Posts: 67413
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.


 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic