布局属性根据指定的TLD无效 [英] The layout attribute is invalid according to the specified TLD

查看:114
本文介绍了布局属性根据指定的TLD无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站需要一个< div> ,但我使用JSF。然后我需要< h:panelGroup> 标记和 layout =block attibute。



我的代码是:

 < h:panelGroup styleClass =contentlayout = 块 > 

但是,我使用的Tomcat服务器返回错误并说:


根据指定的顶级域名,布局属性无效。

我需要帮助,因为我不明白这个错误。

解决方案

布局< h:panelGroup> 的c $ c>属性。这个错误表明你正在使用古老的JSF 1.1或甚至是死的JSF 1.0。

您基本上有2个选项:


  1. 升级到JSF 1.2或者最好是JSF 2.x已经出来超过2年了,差不多已经在2.2版了。您可以在这里下载JSF实现 。请注意,JSP上的JSF 1.2至少需要一个Servlet 2.5兼容容器。所以你需要至少有Tomcat版本6.0,或者最好已经超过2年的Tomcat 7.0。确保您的 web.xml 符合容器支持的最高servlet版本。


  2. 如果您无法升级到JSF 1.2或更新版本,由于您因为某些不明原因而被困在Tomcat 5.5或更旧版本中,则应该忘记使用< h:panelGroup layout> 并改用普通的< div> 元素。您只需要将其封装在< f:verbatim> 中,因为JSF 1.1和更高版本无法正常处理纯HTML。

     < F:逐字>< DIV>< / F:逐字> 
    ...
    < f:verbatim>< / div>< / f:verbatim>




另见:




I need a <div> in my web, but I use JSF. Then I need the <h:panelGroup> tag and layout="block" attibute.

My code is:

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

But, the Tomcat server, that I was used, return error and say:

The layout attribute is invalid according to the specified TLD.

I need help, because I don't understand this error.

解决方案

The layout attribute of <h:panelGroup> was introduced in JSF 1.2. This error suggests that you're using the ancient JSF 1.1 or perhaps even the dead JSF 1.0.

You have basically 2 options:

  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. You can download the JSF implementations here. Note that JSF 1.2 on JSP requires at least a Servlet 2.5 compatible container. 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. Make sure that your web.xml is declared conform the highest servlet version supported by the container.

  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. You only need to wrap it in <f:verbatim> because JSF 1.1 and older cannot treat plain HTML normally.

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

See also:

这篇关于布局属性根据指定的TLD无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆