解决问题 Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier [basicView] resol

最近使用SpringBoot + JSF + PrimeFaces 中,遇到了不少的问题。

Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier [basicView] resolved to null

2018-09-06 14:53:08.043 ERROR 10200 --- [io-8080-exec-10] j.e.resource.webcontainer.jsf.context    : javax.el.PropertyNotFoundException: /basic.xhtml @13,64 value="#{basicView.text}": Target Unreachable, identifier [basicView] resolved to null
	at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
	at org.primefaces.util.ComponentUtils.getConverter(ComponentUtils.java:152)
	at org.primefaces.renderkit.InputRenderer.getConvertedValue(InputRenderer.java:199)
	at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1067)
	at javax.faces.component.UIInput.validate(UIInput.java:981)
	at javax.faces.component.UIInput.executeValidate(UIInput.java:1270)
	at javax.faces.component.UIInput.processValidators(UIInput.java:714)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
	at javax.faces.component.UIForm.processValidators(UIForm.java:253)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
	at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
	at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier [basicView] resolved to null
	at org.apache.el.parser.AstValue.getTarget(AstValue.java:74)
	at org.apache.el.parser.AstValue.getType(AstValue.java:58)
	at org.apache.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:174)
	at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
	... 52 more

原因:

faces-config.xml 中没有配置 “basicView”  的managebean。



    
        org.springframework.web.jsf.el.SpringBeanFacesELResolver
    
    
    
        basicView
        com.ray.primefaces01.entity.BasicView
        session
    

 

附上:

BasicView.java

package com.ray.primefaces01.entity;

import javax.faces.bean.ManagedBean;

/**
 * @author Ray
 * @date 2018/9/6 0006
 */
//@ManagedBean // 使用注释没起作用~
public class BasicView {

    private String text;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}

 

basic.xhtml







    
        
            
            
            
            
        
    

 

你可能感兴趣的:(SpringBoot,JSF)