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 = ????????;
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 = ????????;