This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "closing tag > as value?" Watch "closing tag > as value?" New topic
Author

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
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3274
Have a look here http://www.degraeve.com/reference/specialcharacters.php


< or <


500+ Java Interview Questions and Answers | 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: 16303
    
  21

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>.


Customer surveys are for companies who didn't pay proper attention to begin with.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
thank you!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: closing tag > as value?