Announcement Announcement Module
Collapse
No announcement yet.
FacesJsfResourceRequestHandler deleted Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FacesJsfResourceRequestHandler deleted

    Hi all,

    This is my first post and I've recently started using Spring after many many years with Java SE / J2EE and a good amount of (but less) time with Java EE 6.

    I've been playing with Spring 3 and JSF integration. FYI I've so far found:
    I've been working on #1 in this list and struck a problem with resources.

    I've been looking around and
    Code:
    org.springframework.faces.webflow.FacesJsfResourceRequestHandler
    seems to be something that could help. I found it discussed in several places including http://blog.springsource.org/2010/08...0-m1-released/ and http://forum.primefaces.org/viewtopic.php?f=3&t=3889.

    Though I could not find it in any releases.

    ....

    Oh I see, its been deleted (https://fisheye.springsource.org/bro...stHandler.java) and after some searching the replacement is
    Code:
    org.springframework.faces.webflow.JsfResourceRequestHandler
    Which is exactly what is specified in link #1 above. But wasn't working. I've now got it almost working (I think its just the location of my .css file) by changing the following. From:

    Code:
    <bean id="jsfResourceHandler"
    		class="org.springframework.faces.webflow.JsfResourceRequestHandler" />
    
    	<bean id="simpleUrlHandlerMapping"
    		class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="urlMap">
    			<map>
    				<entry key="/resources/**" value-ref="defaultServletHttpRequestHandler" />
    			</map>
    		</property>
    	</bean>
    To:

    Code:
    <bean id="jsfResourceHandler" class="org.springframework.faces.webflow.JsfResourceRequestHandler" />
    
    	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="order" value="0" />
    		<property name="mappings">
    			<value>
    				/javax.faces.resource/**=jsfResourceHandler
    			</value>
    		</property>
    	</bean>
    Here's a question for anyone who has got this far. Will the following still work to deliver Spring MVC resources:?

    Code:
    <mvc:resources mapping="/resources/**" location="/resources/" />
    Cheers,

    bbos

  • #2
    No, I haven't been able to solve the problem locating resources.

    My helloSpring.xhtml file contains:

    Code:
    <h:head>
    	<title>Hello Spring</title>
    	<h:outputStylesheet library="css" name="style.css" />
    </h:head>
    The output to the console says:

    Apr 20, 2013 10:41:46 PM com.sun.faces.context.ExternalContextImpl getMimeType
    WARNING: JSF1091: No mime type could be found for file css/style. To resolve this, add a mime-type mapping to the applications web.xml.

    The output HTML file contains:

    Code:
    <head>
    	<title>Hello Spring</title><link type="text/css" rel="stylesheet" href="/SpringMVC_JSF_ICEFaces//javax.faces.resource/style.css?ln=css" /></head>
    Which seems to be in order.

    I'm trying to debug this to see how it gets to this point, however I'm still working out debugging the tomcat server (I'm trying out http://eclipse.dzone.com/tips/launch...bugging-tomcat; tomorrow when I'm a little fresher).

    Does anyone have any idea of what is going on here?

    BTW I googled for it but that didn't turn up anything. Oh, and yes there is a mime type for css (and style in web.xml.

    Thanks,

    bbos
    Last edited by bbos; Apr 20th, 2013, 05:39 PM.

    Comment


    • #3
      The link to the css should include 'faces' to force it to be processed by the Faces Servlet:

      Code:
      <link type="text/css" rel="stylesheet" href="/SpringMVC_JSF_ICEFaces/faces/javax.faces.resource/style.css?ln=css" />
      Something about the Spring integration with JSF isn't working 'normally'.

      Comment

      Working...
      X