• Post Reply Bookmark Topic Watch Topic
  • New Topic

verbatim tag  RSS feed

 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, friends
I am playing around (perhaps 'fighting around' is more appropriate) with JSF, and today I realized that nesting JSF tags inside a <f:verbatim> messes up the page handling. My specific situation was this: I had a static HTML page (a prototype) which I had to give life to. Here is what I ended up with at first:

For my surprise, this rendered fine, but the commandLink just didn't work. I mean, it submitted the form, but it just returned to the same JSP instead of executing the intended method. Ending the verbatim tag before commandLink and starting it again right after fixed this, but I am not sure whether this is the right approach. For instance, this is not going to work just like that when I nest the command link in a conditional JSTL tag.
Do you guys have some advice for me? Am I doing something wrong or just akward? Thanks a lot.
[ April 17, 2006: Message edited by: Henrique Sousa ]
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<!-- lots of HTML -->


inside that lots of HTML, do you have any <form> tag ? if yes, it will cause issues like this..

Thanks,
Rajeev
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The f:verbatim content is transient. It means it is not stored in the component tree. Yes, the components will be rendered, but not do not stay in the component tree and will not be in the component tree when request comes to the server and the tree is restored on the first phase of the JSF lifecycle.

So, you have no chance to have jsf components working inside the f:verbatim.

What you cant to do:
* use f:verbatim about the non-jsf content only. Yep. The page code will not look nasted well, but the result html will be fine

* do not use pure html tag, but only the JSF tags. I know it is hard.

* use html layout tag library ( http://www.jsftutorials.net/htmLib/index.html )

* use facelets. ( https://facelets.dev.java.net/ ) . It work with html tags without having verbatim

* use JSF 1.2

--
Sergey : http://jsfTutorials.net
[ April 12, 2006: Message edited by: Sergey Smirnov ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!