Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really Simple XML Config Question

Status
Not open for further replies.

griffindj

Programmer
Apr 21, 2005
3
US
I've got a very simple web app that is made up of two servlets and a jsp. The web app calls a webservice. Servlet A (stub) calls the webservice. Servlet B is my work horse that does all the logic, and the jsp displays it nicely. The app runs fine, but my boss has a hard on for xml and wants the server names in a config file so if the web service's server changes we can plop in the new variables.

Question: How do I reference a static xml file in my jsp or servlet? The xml file will not be generated with code, as it is created before runtime.

Example:

<xml version='blahblah'>
<system-conf>
<description>config of web service variables</description>
<server>
<server-name>SUPERMAN</server-name>
<param-1>USER</param-1>
<param-2>PASSWORD</param-2>
</server>
<server>
<server-name>BATMAN</server-name>
<param-1>USER</param-1>
<param-2>PASSWORD</param-2>
</server>
<server>
<server-name>SPIDERMAN</server-name>
<param-1>USER</param-1>
<param-2>PASSWORD</param-2>
</server>
</system-conf>

in the servlet

String serverNameXML = ????????;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top