<p>In my Servlet I would like to access the root of the context so that I can do some JavaScript minifying.</p>

<p>It would be possible to do the minify as part of the install process but I would like to do it on Servlet startup to reduce the implementation cost.</p>

<p>Does anyone know of a method for getting the context directory so that I can load and write files to disk?</p>

Do you mean:
```
```
public class MyServlet extends HttpServlet {

    public void init(final ServletConfig config) {
        final String context = config.getServletContext();
        ...
    }

    ...
}
```
```
Or something more complex?