Announcement Announcement Module
Collapse
No announcement yet.
SWF JSF 2.0 Integration problem with f:setPropertyActionListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SWF JSF 2.0 Integration problem with f:setPropertyActionListener

    Hi,

    I hope some can help me

    I'm developing a web application based on booking-faces example (spring-webflow-2.3.0.RELEASE) I want part of my application to be in pure JSF 2.0 but I have serious problems with the f:setPropertyActionListener tag.

    From the booking-faces example I only modify to the faces-config.xml file as follows
    Code:
    <?xml version='1.0' encoding='UTF-8'?>
    <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">
    
    	<application>
    		<message-bundle>JsfMessageResources</message-bundle>
    
    		<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    		
    	</application>
    	
    	<managed-bean>
    		<managed-bean-name>viewJSF</managed-bean-name>
    		<managed-bean-class>org.springframework.webflow.samples.booking.ViewJSF</managed-bean-class>
    		<managed-bean-scope>session</managed-bean-scope>
    		<managed-property>
    			<property-name>prueba</property-name>
    			<value>#{prueJSF}</value>
    		</managed-property>
    	</managed-bean>
    	    
    </faces-config>
    Then my .xhtml is:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:c="http://java.sun.com/jsp/jstl/core"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:p="http://primefaces.prime.com.tr/ui">
    
    <f:view>
    <h:head>
    <ui:insert name="headIncludes"/>
    	
    	
    </h:head>
    <h:body>
    <div>
    <h:form> 
    	
      
    <h:commandLink value="link">
    		<f:setPropertyActionListener value="hoho" target="#{viewJSF.funciona}">
    			</f:setPropertyActionListener>
    		</h:commandLink> 
      
    </h:form>  
    </div>
    </h:body>
    </f:view>
    </html>
    The error error occur when I click in the <h:commandLink /> and shows the following error only in the browser (firefox) not in the console.
    Code:
    java.io.FileNotFoundException: /WEB-INF/WEB-INF/intro.xhtml Not Found in ExternalContext as a Resource
    	at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:221)
    	at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:262)
    	at com.sun.faces.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:190)
    	at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:731)
    	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:96)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
    	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
    	at org.springframework.faces.mvc.JsfView.renderMergedOutputModel(JsfView.java:85)
    	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    also the url in the browser goes from http://localhost:8080/booking-faces/spring/intro to http://localhost:8080/booking-faces/...NF/intro.xhtml

    My folder structure is:
    -WEB-INF
    --intro.xhtml


    PLEASE can some body help me, if you need any further explanation Ill reply immediately.

    Thanks in advance

  • #2
    Did you ever figure this out? I don't have the exact same scenario, but getting a similar error. Thanks!

    Comment


    • #3
      I am having the same issue.. The prefix i put in faceletsViewResolver comes up twice when resolving the URL and i dont know why.

      /views/views/login.xhtml Not Found in ExternalContext as a Resource

      viewId=/views/views/login.xhtml
      location=C:\Projects\.metadata\.plugins\org.eclips e.wst.server.core\tmp0\wtpwebapps\caregiver-tc1\views\views\login.xhtml
      phaseId=RENDER_RESPONSE(6)

      Caused by:
      java.io.FileNotFoundException - /views/views/login.xhtml Not Found in ExternalContext as a Resource
      at org.apache.myfaces.view.facelets.impl.DefaultFacel etFactory.resolveURL(DefaultFaceletFactory.java:22 7)

      my prefix is /views and that repeats twice while resolving the view. How can i fix it?

      Comment


      • #4
        Hi,

        I actually wasnt able to fix this, but it was because I was using JSF beans trying not to use spring MVC (because personal reasons) so you might try to use spring MVC beans and you shouldn't have this problems. You my wanna use this annotations

        @Component
        @Scope("request")

        Hope it helps

        Comment

        Working...
        X