tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Drinkwater, GJ (Glen)" <>
Subject RE: Quick Question
Date Tue, 13 Aug 2002 13:11:48 GMT

tomcats default directory is where ever you called the file.
So if you dont use another script to call the file tomcats
default will be the bin directory.

Use this code to find the directory where WEB-INF is.  Then you can traverse
your directory structure from there. 

//get context path
    ServletConfig scon = null ;
    String workingDir = null;
    public void init(ServletConfig config) {
        scon = config ;
 public void doPost(HttpServletRequest request, HttpServletResponse
    throws ServletException, IOException {
        //get working dir
        ServletContext sc = scon.getServletContext();
        workingDir = sc.getRealPath("");

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message