gpt4 book ai didi

jsf - 找不到属性类的 Setter

转载 作者:行者123 更新时间:2023-12-02 08:29:43 26 4
gpt4 key购买 nike

现在,我使用jsf、spring和ibatis编写示例应用程序。我使用facelets并编写template.xhtml、header.xhtml、menu.xml、login.xhtml和主页。登录后发现这个错误。

在浏览器中,

Setter not found for property class
+ Stack Trace
+ Component Tree
+ Scoped Variables

在控制台中,

21:01:20,890 SEVERE [viewhandler] Error Rendering View[/view/SPAR02.xhtml]
java.lang.IllegalArgumentException: Setter not found for property class
at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1645)
at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1526)
at com.sun.facelets.tag.jsf.ComponentRule$LiteralAttributeMetadata.applyMetadata(ComponentRule.java:49)
at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:144)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
at com.sun.facelets.tag.jstl.core.ForEachHandler.apply(ForEachHandler.java:175)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:122)
at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
at com.sun.facelets.tag.jstl.core.ChooseWhenHandler.apply(ChooseWhenHandler.java:45)
at com.sun.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:68)
at com.sun.facelets.tag.jstl.core.ChooseOtherwiseHandler.apply(ChooseOtherwiseHandler.java:41)
at com.sun.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:73)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:268)
at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:98)
at com.sun.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:54)
at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:65)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jp.co.dirbi.falcon.online.security.SessionIdExchangeFilter.doFilter(SessionIdExchangeFilter.java:85)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jp.co.dirbi.falcon.online.component.web.seam.JSessionIDFilter.doFilter(JSessionIDFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at jp.co.dirbi.falcon.online.component.web.seam.SystemFilter.doFilter(SystemFilter.java:253)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

我的template.xml,

<div class="head">    
<ui:include src="header.xhtml"></ui:include>
<div>
<table border="0" class="normal" height="500px" align="center" bgcolor="#F4FFE4">
<tr>
<td width="13%">
<ui:include src="menu.xhtml" />
</td>
<td width="87">
<ui:insert name="body" />
</td>
</tr>
</table>
</div>
<ui:include src="footer.xhtml"></ui:include>

我的主页(SPAR02.xhtml),

<ui:define name="head">
<title>Top Menu</title>
</ui:define>
<ui:define name="body">
<font size="5">Welcome</font>
You can search user informations, update or delete them and can add new user.
</ui:define>

我找不到问题所在,任何人都可以帮助我。

最佳答案

Facelets 尝试将属性 class 设置为不接受此属性的组件。大多数时候,HTML class 属性的属性是 styleClass

我在您提供给我们的代码中没有看到问题。问题可能出在 Facelets 页面的任何位置。

参见this question for more information .

关于jsf - 找不到属性类的 Setter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17194472/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com