0

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
edgarzamora
  • 1,472
  • 1
  • 9
  • 17
  • :P You seems to be using the invisible ink. Do I need to pour lemonade onto my laptop's screen? – Mr.J4mes Jan 04 '12 at 17:10
  • @Mr.J4mes: the OP did not read the markdown formatting rules nor did he paid attention to the message preview area below the message editor. I have edited the question and fixed the code formatting accordingly. Indenting code with 4 spaces will format it properly instead of be hidden because it's interpreted as HTML. In the future "invisible code" questions of this kind you could click *edit* link to see what the questioner actually has entered (and if necessary edit/improve it! :) ). – BalusC Jan 04 '12 at 18:07
  • @BalusC thanks for reminding me :P. I kept forgeting that I can do that. – Mr.J4mes Jan 04 '12 at 18:15
  • Thanks, this is my first post. Sorry :D – edgarzamora Jan 05 '12 at 00:02

1 Answers1

2

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:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555