Have a look at how can i have access to my files that placed in WEB-INF folder. It might be of help. Besides, if you are using JSF 2.0, Facelets, you can simply get your context root in your jsf pages as
<ui:param name="root" value="#{request.contextPath}" />
and wherever you need to access files inside your context root, you may access them as(hypothetical example)
<img src="#{root}/resources/images/sample.jpg" />
At the java side, you can get the context path as
String contextPath = FacesContext.getCurrentInstance().getExternalContext().getContextName();
Hope this helps.