I have a config file in WEB-INF/conf and I pass the location using an
init-param (called propfile) to a servlet. Then in the servlet I use

                propFile = getServletConfig().getInitParameter("propfile");
                base = getServletContext().getRealPath("") + FS;

where FS is

              protected static final String FS = File.separator;

works with Jetty (GAE/J Dev server), Tomcat, GAE/J.



On Jul 16, 3:00 pm, Love Yao <[email protected]> wrote:
> I want to read the config.xml in my  webRoot /WEB-INF/classes/
> config.xml.
>
> All is OK in localhost.
>
> but when deploying to GAE, it cannot find the xml:
>
> /base/data/home/apps/mainloveplay/4.351871111093106408/base/data/home/
> apps/mainloveplay/4.351871111093106408/WEB-INF/classes/config.xml (No
> such file or directory)
>
> the code to get path is:
>
> String rootPath =
> ConfigRepository.class.getResource("/").getPath().substring(1);
> Document document = reader.read(new File(rootPath + "config.xml"));
>
> so how can I get my config.xml????????????

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to