简体   繁体   English

根据指定的TLD,布局属性无效

[英]The layout attribute is invalid according to the specified TLD

I need a <div> in my web, but I use JSF. 我的网站中需要一个<div> ,但是我使用的是JSF。 Then I need the <h:panelGroup> tag and layout="block" attibute. 然后,我需要<h:panelGroup>标签和layout="block"外观。

My code is: 我的代码是:

<h:panelGroup styleClass="content" layout="block">

But, the Tomcat server, that I was used, return error and say: 但是,我曾经使用过的Tomcat服务器返回错误并说:

The layout attribute is invalid according to the specified TLD. 根据指定的TLD,布局属性无效。

I need help, because I don't understand this error. 我需要帮助,因为我不了解此错误。

The layout attribute of <h:panelGroup> was introduced in JSF 1.2. JSF 1.2中引入了<h:panelGroup>layout属性。 This error suggests that you're using the ancient JSF 1.1 or perhaps even the dead JSF 1.0. 该错误表明您正在使用古老的JSF 1.1甚至是已失效的JSF 1.0。

You have basically 2 options: 您基本上有2个选择:

  1. Upgrade to JSF 1.2 or preferably to JSF 2.x which is been out for over 2 years already and almost at version 2.2. 升级到JSF 1.2或最好升级到JSF 2.x,该版本已经存在两年多了,并且几乎是2.2版。 You can download the JSF implementations here . 您可以在此处下载JSF实现。 Note that JSF 1.2 on JSP requires at least a Servlet 2.5 compatible container. 注意,JSP上的JSF 1.2至少需要一个Servlet 2.5兼容的容器。 So you need to have at least Tomcat version 6.0 or preferably Tomcat 7.0 which is been out for over 2 years already as well. 因此,您至少需要拥有Tomcat 6.0或Tomcat 7.0,并且已经有2年以上的历史了。 Make sure that your web.xml is declared conform the highest servlet version supported by the container. 确保您声明的web.xml符合容器支持的最高servlet版本。

  2. If you can't upgrade to JSF 1.2 or newer, because you're stuck to Tomcat 5.5 or older for some unclear reason, then you should forget using <h:panelGroup layout> and use a normal <div> element instead. 如果由于某些不清楚的原因而无法使用Tomcat 5.5或更高版本,则无法升级到JSF 1.2或更高版本,则应忘记使用<h:panelGroup layout>而应使用常规的<div>元素。 You only need to wrap it in <f:verbatim> because JSF 1.1 and older cannot treat plain HTML normally. 您只需要将其包装在<f:verbatim>因为JSF 1.1及更早版本无法正常处理纯HTML。

     <f:verbatim><div></f:verbatim> ... <f:verbatim></div></f:verbatim> 

See also: 也可以看看:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 根据TLD,属性类别对于标签形式无效 - Attribute class invalid for tag form according to TLD 简单的JSP-根据TLD,标签的属性无效 - Simple JSP - Attribute invalid for tag according to TLD 根据 TLD 获取标签 [form] 的属性 [modelAttribute] 无效 - Getting Attribute [modelAttribute] invalid for tag [form] according to TLD HTTP状态500-org.apache.jasper.JasperException-属性名称对于根据TLD提交标签无效 - HTTP Status 500 - org.apache.jasper.JasperException--Attribute name invalid for tag submit according to TLD springboot org.apache.jasper.JasperException根据TLD的标签,该属性无效 - springboot org.apache.jasper.JasperException Attribute invalid for tag according to TLD 为什么jsp apply struts2总是根据TLD显示tag url的属性id无效? - Why the jsp apply struts2 always display attribute id invalid for tag url according to TLD? 根据TLD或标签文件,标签文本必须使用属性名称 - According to the TLD or the tag file, attribute name is mandatory for tag text 根据标签文件中的TLD或属性指令,属性值不接受任何表达式 - According to TLD or attribute directive in tag file, attribute value does not accept any expressions Spring JSP:根据TLD或标签文件,标签输入必须使用属性路径 - Spring JSP : According to the TLD or the tag file, attribute path is mandatory for tag input JSP 中的错误(/index1.jsp(行:[16])根据标记文件中的 TLD 或属性指令,属性 [items] 不接受任何表达式) - Error in JSP (/index1.jsp (line: [16]) According to TLD or attribute directive in tag file, attribute [items] does not accept any expressions)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM