2013-05-10 2 views
0

Java bean에 내 jsf 파일을 연결하려고합니다. 그것은 자바 콩에서 찾고있는 속성이 존재하지 않는다고 말하는 오류를 제공하고 있습니다. 그러나 그것은 콩 클래스에 존재합니다. 좀 도와 줄 수있어?JSF Java bean 속성 연결 문제

기능적인 흐름이 목록을 입력을 받아 빈에서 메소드를 실행하고 반환합니다 index.xhtml이다는 당신이 당신의 빈에서 getRouetListDataClassgetRouteListDataClass 철자 한 routesbystop.html

**index.xhtml** 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:p="http://primefaces.org/ui"> 

<ui:composition template="/WEB-INF/templates/base_template.xhtml"> 
    <ui:define name="content"> 
     <h:form> 
      <h:body style="background:#F0F8FF"> 
       <div 
        style="text-align: center; margin: 10px auto; padding: 5px 10px 5px 10px; border-bottom: dotted 1px #7c7c7c; overflow: hidden;"> 
        <h1>Welcome to Toronto Bus Route</h1> 
        <h:commandButton action="routes" value="Retrieve Available Routes"/><br></br> 
        <h:inputText id="stopId" value="stopId"/><br></br> 
        <h:commandButton action="routebystop" value="Search" id="SearchRouteByStopId"/> 
       </div> 
      </h:body> 
     </h:form> 
    </ui:define> 
</ui:composition> 
</html> 



**routebystop.xhtml** 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:p="http://primefaces.org/ui" 
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"> 
<f:metadata> 
    <f:event type="preRenderView" listener="#{routeByStopBean.retrieveSubRoutes}"></f:event> 
</f:metadata> 
<ui:composition template="/WEB-INF/templates/base_template.xhtml"> 
    <ui:define name="content"> 
     <h:form> 
      <h:body style="background:#F0F8FF"> 
       <p:dataTable id="dataTable" var="routeByStopListData" 
        value="#{routeByStopBean.routeListDataClass}" 
        emptyMessage="No routes are found." 
        paginator="#{fn:length(routeByStopBean.routeListDataClass) > 10}" 
        rows="10" 
        paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
        rowsPerPageTemplate="20,50,100" rowVarIndex="rowIndex"> 
        <f:facet name="header"> 
          List of Stops 
         </f:facet> 
        <p:column headerText="Route Id"> 
         <h:outputText value="#{routeByStopListData.routeNumber}" /> 
        </p:column> 
        <p:column headerText="Route Name"> 
         <h:outputText value="#{routeByStopListData.routeName}" /> 
        </p:column> 
       </p:dataTable> 
      </h:body> 
     </h:form> 
    </ui:define> 
</ui:composition> 
</html> 

faces-config 

<?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_1.xsd" 
    version="2.1"> 
    <navigation-rule> 
     <display-name>WEB-INF/route.xhtml</display-name> 
     <from-view-id>/routes.xhtml</from-view-id> 
     <navigation-case> 
      <from-outcome>stops</from-outcome> 
      <to-view-id>stops.xhtml</to-view-id> 
     </navigation-case> 
    </navigation-rule> 
    <navigation-rule> 
     <display-name>WEB-INF/index.xhtml</display-name> 
     <from-view-id>/index.xhtml</from-view-id> 
     <navigation-case> 
      <from-outcome>routebystop</from-outcome> 
      <to-view-id>routebystop.xhtml</to-view-id> 
     </navigation-case> 
    </navigation-rule> 
</faces-config> 

Bean class 

package com.nextbus.ttc.bean; 

import java.util.List; 

import javax.faces.bean.ManagedBean; 
import javax.faces.bean.SessionScoped; 
import javax.faces.context.FacesContext; 
import javax.faces.event.ComponentSystemEvent; 

import com.nextbus.ttc.dto.RouteListDataClass; 
import com.nextbusroute.ttc.xmlparser.RouteListByStopDataHandler; 

@ManagedBean 
@SessionScoped 
public class RouteByStopBean { 

    public List<RouteListDataClass> routeListDataClass; 

    public void retrieveSubRoutes(ComponentSystemEvent event) { 
     if (!FacesContext.getCurrentInstance().isPostback()) { 
      String stopNumber = (String) FacesContext.getCurrentInstance() 
        .getExternalContext().getRequestParameterMap() 
        .get("stopId"); 
      RouteListByStopDataHandler s = new RouteListByStopDataHandler(); 
      routeListDataClass = s.getRouteListByStop(stopNumber); 
     } 
    } 

    /** 
    * @return the RouteListDataClass 
    */ 
    public List<RouteListDataClass> getRouetListDataClass() { 
     return routeListDataClass; 
    } 

    public void setRouteListDatas(List<RouteListDataClass> routeListDataClass) { 
     this.routeListDataClass = routeListDataClass; 
    } 

} 

Error - 


ception 

javax.servlet.ServletException: Property 'routeListDataClass' not found on type com.nextbus.ttc.bean.RouteByStopBean 
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:521) 
root cause 

javax.el.PropertyNotFoundException: Property 'routeListDataClass' not found on type com.nextbus.ttc.bean.RouteByStopBean 
    javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:237) 
    javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:214) 
    javax.el.BeanELResolver.property(BeanELResolver.java:325) 
    javax.el.BeanELResolver.getValue(BeanELResolver.java:85) 
    com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) 
    com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) 
    org.apache.el.parser.AstValue.getValue(AstValue.java:183) 
    org.apache.el.parser.AstFunction.getValue(AstFunction.java:103) 
    org.apache.el.parser.AstGreaterThan.getValue(AstGreaterThan.java:38) 
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185) 
    com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) 
    javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:193) 
    org.primefaces.component.api.UIData.isPaginator(UIData.java:90) 
    org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:152) 
    org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:82) 
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:884) 
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681) 
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677) 
    javax.faces.render.Renderer.encodeChildren(Renderer.java:168) 
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:854) 
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1674) 
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677) 
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399) 
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) 
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) 
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) 
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:509) 
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.39 logs. 

Apache Tomcat/7.0.39 
+0

이 질문은 오타이기 때문에 주제가 아닌 것으로 보입니다. –

답변

0

에 표시합니다.