tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juergen Baumann" <juergenbaum...@yahoo.com>
Subject <context-param> 4.0 vs. 3.2b5 and 3.1
Date Thu, 28 Sep 2000 14:34:56 GMT
I hope this is the right forum to post this finding. 
In order to pass on the relative directory name to my servlet, I have the following in my
web.xml file:

<context-param>
        <param-name>resultDir</param-name>
        <param-value>
         WEB-INF/f1/resultfiles/
        </param-value>
    </context-param>

In my servlet I do:
.....
ServletContext context = getServletContext();
 context.log("F1AdminServlet started");
.....
virtualPath = context.getInitParameter("resultDir");
 resultDir = context.getRealPath(virtualPath);
........
 try {
  InputStream is = new FileInputStream(resultDir + "sum.properties");
  sumProps.load(is);
  is.close();
 } catch (FileNotFoundException e) {
  // no sumProps available => new file will be generated
  // as soon as 1. user is finished
  System.out.println("No sumProps file available");
  return;
 } catch (IOException e) {
  System.out.println(e);
  System.out.println("in F1AdminServlet");
  return;
 }
 ............

with 3.1 and 3.2b5 the path is:  ...WEB-INF/f1/resultfiles/sum.properties
with 4.0m1 it seems to be: ....WEB-INF/f1/resultfilessum.properties

so the last "/" of "WEB-INF/f1/resultfiles/" seems to be not passed on with 
getInitParameter();

pls let me know if I have to change something in the web.xml file or what else I can do.

Thanks in advance
JB





Mime
View raw message