Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Christopher Whu
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use Facelets, there is nothing wrong with mixing JSF with plain HTML tags.
 
Christopher Whu
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir! Just wanted to hear some real world advice...
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marcin Majewski
Greenhorn
Posts: 14
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!