Hi- I'm writing a couple of filters that our apps will use. I want each app to provide for its own config.fil under /web-inf/. My filters will be deployed as a jar on WAS. In my doFilter method I want to resolve the path to the comfig file e.g. (in doFilter) String cfgFilepath = httpReq.getServerName() +httpReq.getServerPort() +httpReq.getContextPath() +"/WEB-INF/redirect-config.xml"; Parser p = new Parser(); //a SAX parser p.processFile(cfgFilepath); p.listData();
I'm not getting close to my file. Anyone know a way to do this? many thanks, max
Why do you care what the "real" path is? Why not use ServletContext.getResource() which returns a URL object representing a resource relative to the document root (which never changes for your webapp). That should get the job done.
James Carman, President<br />Carman Consulting, Inc.
Joined: Jul 17, 2001
That'll do nicely, sir. Thanks for this very helpful tip. Max Tomlinson