Forums Register Login

Real world, do you guys use some HTML in your JSF pages?

+Pie Number of slices to send: Send
I am going to add JSF to a project i am working on and the existing template is kinda complex. To achieve a seamless look from going from non JSF pages to my JSF applications is it okay to use the html tags?

wondering what your experiences with this have been...
+Pie Number of slices to send: Send
If you use Facelets, there is nothing wrong with mixing JSF with plain HTML tags.
+Pie Number of slices to send: Send
Thank you sir! Just wanted to hear some real world advice...
+Pie Number of slices to send: Send
However, as a long-term goal, I recommend phasing out the HTML on the JSF pages themselves. Mixing JSF and HTML limits your options and exposes you to potential problems if a later JSF version's internal HTML generation does something that doesn't work well with your manual HTML.
+Pie Number of slices to send: Send
 

later JSF version's internal HTML generation does something that doesn't work well with your manual HTML.


What can it be? As long as components generate standards compliant HTML and the same is done by the developer manually, I don't see any problems.
+Pie Number of slices to send: Send
 

Christopher Whu wrote:I am going to add JSF to a project i am working on and the existing template is kinda complex. To achieve a seamless look from going from non JSF pages to my JSF applications is it okay to use the html tags?

wondering what your experiences with this have been...



As usualy... it depends. I've been lately working on a project where customer provided the exact application layout. The project's schedule was tight and we're ordered to develop in ADF framework in which it's quite hard to redefine layouts (at least for newbies) so all we did was to incorporate dynamic JSF components into the provided layouts. It's probably not a good programming style, but because of the fact that it is usually the same developer that designs layout and provide the underlying code there are no maintenance problems. My advise would be to use JSF where you need bindings with model and application control. In my opinion this is not of the greatest importance whether you'll use JSF for presentation components (i.e. div instead of <h:panelGroup layout="block"/>
+Pie Number of slices to send: Send
 

Max Katz wrote:

later JSF version's internal HTML generation does something that doesn't work well with your manual HTML.


What can it be? As long as components generate standards compliant HTML and the same is done by the developer manually, I don't see any problems.



The JSF renderers generate on-the-fly and their HTML output isn't always fixed. For example, some elements can render either <div> or <span>. The other JSF elements in the view can co-ordinate on this kind of stuff, but the raw HTML is static.

It gets worse when you use extensions such as IceFaces, Tomahawk or ADF, as these and other extension tagsets have their own set of CSS styles, often generated dynamically. Once again, the styles are co-ordinated with other elements, but not with static items.

Where you really get nailed, however, is when someone hits you up with a need to render to non-HTML, such as WAP. JSF can simply switch to a WAP renderkit, but the raw HTML will still output as raw HTML. Which can look really ugly on a display that doesn't understand HTML.
+Pie Number of slices to send: Send
Could be, but with all modern mobile devices (phones, tablets) having a regular web browser (in some cases more powerful than on PC), I don't see WAP as being an issue.
+Pie Number of slices to send: Send
 

Max Katz wrote:Could be, but with all modern mobile devices (phones, tablets) having a regular web browser (in some cases more powerful than on PC), I don't see WAP as being an issue.



There are a lot more ways to render data than just HTML and WML. For example, VRML (audio interface) and PDF. Check out the Cocoon project. Cocoon pretty much specializes in alternative rendering systems.

I've received PDF's with HTML jammed in them.
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1817 times.
Similar Threads
Can't set invisible border for Table inside P:dataTable.
JSF: should we use it?
JSF and Character Sets (UTF-8 mainly)
using XHTML & JSP in the same application
Problem rendering facelets templates
JSF vs Struts
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:32:40.