<p>I am new to java so excuse my lame questions:)</p>

<p>I am trying to build a web service in Java  NetBeans 6.1 , but I have some troubles with configuration parameters ( like .settings in .net).</p>

<p>What is the right way to save and access such settings in a java web service.</p>

<p>Is there a way to read context parameters from web.xml in a web method?</p>

<p>If no what are the alternatives for storing your configuration variables like pathnames ?</p>

<p>Thank you</p>

If you are using servlets, you can configure parameters in web.xml:
```
```
<servlet>
  <servlet-name>jsp</servlet-name>
  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
      <param-name>fork</param-name>
      <param-value>false</param-value>
     </init-param>
</servlet>
```
```
These properties will be passed in a ServletConfig object to your servlet's "init" method.
Another way is to read your system's environment variables with
```
```
System.getProperty(String name);
```
```
But this is not recommended for other than small programs and tests.
There is also the Properties API if you want to use ".properties" files.
http://java.sun.com/javase/6/docs/api/java/util/Properties.html
Finally, I believe looking up configurations with JNDI is pretty common when developing modern web service applications, Netbeans and app containers have pretty good support for that. Google it.