• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic