This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF including HTML within a method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF including HTML within a method" Watch "JSF including HTML within a method" New topic
Author

JSF including HTML within a method

mar mm
Greenhorn

Joined: May 30, 2010
Posts: 5
Hi guys, is anyone able to help me? I'am still new with JSF.
I would like to create a method that holds HTML code. Then, i would like just to call that method inside my JSF page, to insert the HTML. And if there is a need to change something, i would do it in one place only.

To explain you more detaily, i'll show you how I made this in PHP.
I made file named fje.php:

Offcourse, there is a lot more HTML and JavaScript code inside functions.
Then, i would create PHP page:


Is it possible to create something like this with JSF. Or is there other way to do this?
Thanks in advance
bert brutzel
Greenhorn

Joined: May 28, 2010
Posts: 6
sure, you can do this with templates ...
mar mm
Greenhorn

Joined: May 30, 2010
Posts: 5
Could you explain me little closer?
bert brutzel
Greenhorn

Joined: May 28, 2010
Posts: 6
have a look a this: Coreservlets
Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 146

This is a good place to starting learning facelets.

http://jsflessons.blogspot.com/2009/03/intorduction-to-facelets.html


Adolfo Eloy
Software Developer
OCPJP 6
mar mm
Greenhorn

Joined: May 30, 2010
Posts: 5
Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF including HTML within a method
 
Similar Threads
postback model and AJAX
Architecture
Problem rendering facelets templates
Dynamic HTML page titles using jsp
Including JSP templates in Taglibs