[英]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个选择:
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版本。
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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.