File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes closing tag > as value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "closing tag > as value?" Watch "closing tag > as value?" New topic

closing tag > as value?

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
How can I set the value ">=" to my Label?

does not work as > is recogniced as a closing tag.

This does also not work:

arulk pillai
Ranch Hand

Joined: May 31, 2007
Posts: 3359
Have a look here

< or <

[] | [Java job hunting know how] | [Java resumes]
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
thanks !
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17257

Or, to bring it inline, JSF is an XML form, so it obeys XML rules. There are 5 characters that XML parsers are sensitive to, and which may require escaping (entity specification):

< &lt;
> &gt;
" &quot;
' &apos;
& &amp;

Note that the ";" at the end is required - I've seen some sloppy sites that left them off because apparently some browsers weren't diligent about proper form, but that meant that unless you were running the proper browser, the site looked like an amateur job.

I mentioned that JSF is XML form. You can use JSF in an HTML context, where the rules may be more lax, but I personally recommend using an actual XML context such as xhtml. That way you have the benefit of tools that will do that little extra bit of validation at source time. Also it's easier for automated tools to work with XML formats, since they don't have the unpredictability of raw HTML. For example, unbalanced tags such as <br>.

An IDE is no substitute for an Intelligent Developer.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
thank you!!
I agree. Here's the link:
subject: closing tag > as value?
It's not a secret anymore!