开发者

Spring WebFlow JSF 2.0 Integration problem with f:setPropertyActionListener

I开发者_JAVA百科'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. It doesn't redirect properly.

From the booking-faces example I have only modified the faces-config.xml file as follows:

<?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>

My Facelet file intro.xhtml is:

<!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}" />
                </h:commandLink> 
            </h:form>  
        </div>
    </h:body>
</f:view>
</html>

The exception which occurs when I click <h:commandLink />:

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 address bar goes from http://localhost:8080/booking-faces/spring/intro to http://localhost:8080/booking-faces/WEB-INF/intro.xhtml

My folder structure is:

-WEB-INF
--intro.xhtml

I've already asked this question on Spring WebFlow forum, but I didn't get any response.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜