ERROR [nemo] (default task-1) exception passed to NewExceptionHandlerWrapper:
jakarta.faces.view.facelets.TagAttributeException:
/resources/components/new/commandLink.xhtml @53,44 test="#(lempty
cc.attrs.action) jakarta.el.PropertyNotFoundException: /layouts/navigator.xhtml @252,11
action="#(newHomeController.doSearch)": The
class 'as.cbn.new.web.controllers.NewHomeController' does not have the property 'doSearch'.
ERROR [stderr]
(default task-1) jakarta.faces.view.facelets.TagAttributeBxception: /resources/components/new/commandLink.xhtml 853,44
test="#(lempty cc.attrs.action)"
jakarta.el.PropertyNotFoundException: /layouts/navigator.xhtml 0252,166 action=*# (newHomeController.doSearch)": The
class 'as.cbn.new.web.controllers.NewHomeController' does not have the property 'doSearch'
action="#{newHomeController.doSearch()}"
我对 navigator.xhtml 中的每个操作属性都尝试过此操作,之后我收到了如下所示的另一个错误
ERROR [nemo] (default task-1) exception passed to NewExceptionHandlerWrapper: java.lang.ClassCastException: class java.lang.String cannot be cast to class jakarta.el.ValueExpression (java.lang.String is in module java.base of loader 'bootstrap'; jakarta.el.ValueExpression is in unnamed module of loader '[email protected]' @71f5fb18)
ERROR [stderr] (default task-1) java.lang.ClassCastException: class java.lang.String cannot be cast to class jakarta.el.ValueExpression (java.lang.String is in module java.base of loader 'bootstrap'; jakarta.el.ValueExpression is in unnamed module of loader '[email protected]' @71f5fb18)
ERROR [stderr] (default task-1) at [email protected]//com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager$ArbitraryMethodRegargetHandler.retarget(FaceletViewHandlingStrategy.java:1583)
我们用过
仅编译 'org.glassfish:jakarta.faces:4.0.5'
实现“org.primefaces:primefaces:12.0.0:jakarta”
实现“jakarta.el:jakarta.el-api:6.0.0”
仅编译 'jakarta.platform:jakarta.jakartaee-api:10.0.0'
xhtml 中的命名空间是这样的
<html xmlns:faces="jakarta.faces"
xmlns:f="jakarta.faces.core"
xmlns:h="jakarta.faces.html"
xmlns:c="jakarta.tags.core"
xmlns:ui="jakarta.faces.facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:new="jakarta.faces.composite/components/new">
web.xml - 版本-6.0-jakarta
faces-config.xml - 版本 4.0
ejb-jar.xml - 版本 4.0
beans.xml - 版本 4.0
这里的错误是你的控制器
as.cbn.new.web.controllers.NewHomeController
没有在EL表达式中使用的doSearch
属性
action="#{newHomeController.doSearch()}"
我认为您的类中缺少
doSearch
方法,或者应该在 EL 表达式中设置不带括号的方法。