vwiencek
vwiencek

Reputation: 1

Spring 3 / JSF 2 / javax.faces.resource not correclt loaded

I'm trying to set up a new project including

Everything work fine, except that javax.faces.resource/* seems unreachable.

GET http://feelgood-inc.net:8080/jrisk-web-ui/*/javax.faces.resource/richfaces.js 404 (Not Found)

I suspect the problem comes from the "//" in front of the "javax.faces". When I delete the /, it works fine.

GET http://feelgood-inc.net:8080/jrisk-web-ui/javax.faces.resource/richfaces.js Works !

Has anyone ever encountered this problem ? I cannot get rid of the extra "/*" in front of each javax.faces.resource call ....

my faces-config.xml

<faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
       http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"
version="2.1">

</faces-config>

my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>

<!-- Creates the Spring Container shared by all Servlets and Filters -->
<!-- The Bootstrap listener to start up and shut down Spring's root WebApplicationContext. It is registered to Servlet Container -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
</servlet>

<servlet>
    <servlet-name>Spring MVC Servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Spring MVC Servlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>

<context-param> 
    <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
    <param-value>*.xhtml</param-value>
</context-param>

my spring mvc configuration

    <beans:bean name="richfacesResourceHandler"      
 class="org.springframework.faces.webflow.JsfResourceRequestHandler" />

<beans:bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <beans:property name="order" value="0" />
    <beans:property name="mappings">
        <beans:value>
            /javax.faces.resource/*=richfacesResourceHandler
            /rfRes/**=richfacesResourceHandler
        </beans:value>
    </beans:property>
</beans:bean>

<faces:resources />

Upvotes: 0

Views: 2274

Answers (2)

CannyDuck
CannyDuck

Reputation: 369

Take a look at this JIRA ticket:

https://jira.springsource.org/browse/SWF-1552

Upvotes: 0

nww
nww

Reputation: 11

How about changing 2.1 to 2.0?

<faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
       http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0">
</faces-config>

Upvotes: 1

Related Questions