I add a file under “webapp”,but how can I access it?
The server is tomcat and Spring framework as framework.
Thanks in advance.
Here is some code and output:
System.out.println("dddddddddddddddddddddddddddd");
//System.out.println(path.getPath());
InputStream is = getClass().getResourceAsStream("/WEB-INF/GroupWebService.xml");
if (null == is ){
System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeeeee");
}
And the output is
log4j:WARN Please initialize the log4j system properly.
dddddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeeeee
Mar 15, 2012 1:55:52 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'application'
You can use
Which will probably print path of your project directory and then you can use following statement to traverse to your WEB-INF