Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is it need to use verbatim to enclosed all non-jsf tag?

 
peter tong
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it seems very trouble if we need to enclosed all non jsf tag (like html) with verbatim tag in jsp!!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but if you can use Facelets as your view renderer, you can get rid of these verbatim tags.
 
peter tong
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so terrible?!! need to write <f:verbatim/> each time I write html inside jsf tags!!!?

how difficult to learn facelets? I need to start my project using jsf by now!!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, it's not really effective JSF if you are even using non-JSF tags.

JSF is intended to be a semantic framework with a decoupled rendering mechanism. In practical terms, that means things like being (potentially) to use the same application code on both standard HTML and WAP page-based systems, to be able to render raw graphics without any the need for HTML at all, and to be able to render items in a mixed mode such as HTML/JavaScript (AJAX).

If you go around dropping chunks of HTML in the abstract page definition, you defeat that intention. It may not bite you today, and it probably won't even bite you to morrow. But there may come a time when you'll wish you hadn't.
 
Bart Kummel
author
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should learn Facelets! It is fairly simple to use, in fact easier to use than JSP. I agree with Tim that ideally you should not have any (X)HTML code in your JSF page definition. But I know it may be a good pragmatic solution sometimes. A good compromise may be to use Facelets templates. You can keep the actual page definitions strictly abstract JSF page definitions then and only add some (X)HTML to your Facelets template(s).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic