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

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -