java - Why does servletContext.getRealPath returns null on tomcat 8? -


i have following code line:

servletcontext.getrealpath("resources/images/video_icon.png") 

wen run application using jetty(using maven plugin) code line return corect value.

when run application using tomcat 8(on tomcat 7 works) - application returns null.

application structure:

enter image description here

1.how fix it?
2.why happen?

after adding / in path beginning works in both: jetty , tomcat 8

servletcontext.getrealpath("/resources/images/video_icon.png") 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -