tomcat-users mailing list archives

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

tomcats default directory is where ever you called the startup.sh/bat file.
So if you dont use another script to call the startup.sh/bat 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
response)
    throws ServletException, IOException {
      
        //get working dir
        ServletContext sc = scon.getServletContext();
        workingDir = sc.getRealPath("");


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message