JSF url problem

Hi

My index.jsp has its images in a folder cold img placed in /web along with index.jsp. But index.jsp is used to in the faces context and when i deploy my application, it can't find the images because index.jsp has /faces/index.jsp url.

How can i solve this problem?

I could put the link to the images like ../img/, but i don't want to modify my page.

[380 byte] By [Powerhouse_ba] at [2007-11-27 4:54:12]
# 1

If you don't want to change the page you'll need to change how the faces servlet is mapped in the web.xml.

I have a huge dislike for the /faces/*

here is my suggestion, in the web.xml replace

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>/faces/*/url-pattern>

</servlet-mapping>

with

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.jsf</url-pattern>

</servlet-mapping>

this will cause your index.jsp to be in the context root and should see your images directory.

-toby

skepticala at 2007-7-12 10:08:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...