I have written a java web service and I need to add a config file to store things like Client Name that will change on a client by client basis. I am looking for something similar to the .net web.config file.
I have tried the web.xml file, but I have been unable to get that to work. Most solutions I've found are to be used in servlets, which I am not using in this project. There was one solution I found that reads the xml file, but it required a Naming exception to be thrown from the method and the web service was not deployable.
I'm a .net developer just starting to learn java. I'm not sure where to look to solve this problem. I'm sure I'm missing something obvious.
Here are some code samples I've played with to try to read the web.xml file.
Context ctx = new InitialContext();
Context env = (Context) ctx.lookup("java:comp/env");
String filename = (String) env.lookup("file-name");
and
String email= getServletContext().getInitParameter("AdministratorEmail");