Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

<span> can't be used in a Trinidad + Facelet project  RSS feed

 
zenius lee
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Trinidad and spring web flow in my project. Right now I meet a strange problem.
I create a facelet template like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
xmlns:sf="http://www.springframework.org/tags/faces"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html"
contentType="text/html" encoding="UTF-8">

...

I put this like
<li><a href="custom_home.jsp" title="Links to xxx"><span>xxxxx</span></a></li>

but something magic happen, the generated html becomes:
<li><a href="custom_home.jsp" title="Links to xxx">xxxxx</a></li>

<span> has been removed by Facelet or trinidad, do you know the reason or how to fix it?
Many css classes don't work without span tag.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF isn't ultimately an HTML framework. It's an abstract framework supported by a set of renderers, the most popular of which renders output as HTML.

So it's NOT a good idea to insert HTML into the JSF view definition. It breaks portability. And, as you have seen, it can be discarded as garbage.

In most cases, the JSF tags have direct semantic view support, so it's usually sufficient to use the appropriate JSF tag attributes such as rowClasses, columnClasses, and where nothing more precise is available, the style and styleClass attributes.

If it's absolutely positively necessary to inject raw HTML into the view definition, use the <f:verbatim> tag to wrap it.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This shouldn't occur in JSF 1.2 on JSP 2.1.

Are you using JSF 1.1 or older or so?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!