File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes HTML tags in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "HTML tags in JSF" Watch "HTML tags in JSF" New topic
Author

HTML tags in JSF

Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245
Hi guys,

I have a JSF page where I'm outputting some text into a dataList (Tomohawk) i.e. a result from a form submission. I want to be able to format the the output i.e. use the <br>, <a href...> or <p> html tag inside the dataList. However JSF doesn't seem to be recognising the html tags.

Hence I've used the <f:verbatim> to insert the <br> tag, see below



Is the method correct, it seems to work.
What I dont want is for it to have repurcussions later on when my app becomes much more complex.

Thanks for your thoughts in advance, regards
Zein
John Bartlett
Ranch Hand

Joined: Jan 25, 2006
Posts: 116
Got to ask why are you using html tags?

Why not instead of <a href="" /> use <h:commandLink />?

John
Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245
Ahh yes John that was an oversight. <a:href .... shouldn't have been there. My main issue was the <br>, if put that there without the <f:verbatim> tags, it is ignored. Hence my question in essence is <f:verbatim> really neccasary if I just want to put need a <br> or <p>?

I hope that makes sense, essentially I have a loop and after each iteration I need a gap between what is output hence <br> or <p>.

Thanks for your thoughts
Zein
John Bartlett
Ranch Hand

Joined: Jan 25, 2006
Posts: 116
ah ok. have you tried <br /> and <p />?
[ June 08, 2007: Message edited by: John Bartlett ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML tags in JSF