• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JSF output

 
Ranch Hand
Posts: 153
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the body of an HTML page contains JSF tags, then why doesn't the browser render the body as pure text? Isn't that the default behavior of a browser when it encounters text it cannot parse properly?

Why does the following code result in a white page?


p.s.: I'm talking from a disconnected point of view. This page is not hosted on a webserver and I am aware of this. I am just curious of the default browser behavior.
I am using Google Chrome.
 
Saloon Keeper
Posts: 28663
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand.

The View Definition Language, alias View Template Language, alias .xthml is an abstract XML notation that defines a view independent of the destination media. JSF renders Views by taking the compiled Component tree of the View and passing it through a renderer. Renderers are actually plug-in subsystems, however by far the most commonly-used one (and the one that the Facelets subsystem favors) is the HTML renderer.

The browser doesn't understand VTL. It only understands HTML, but that's OK, since that's what JSF's HTML renderer sends back to it. In the event that a View Definition contains unknown tags, it's the decision of the JSF renderer as to what to do with it.

Incidentally, that's why I don't encourage raw HTML on a View template. If you aren't using the HTML renderer, but instead are using some other sort of renderer, such as a PDF renderer, the HTML tags will typically come out as noise in the resulting view because JSF treats them as data instead of JSF information.
 
reply
    Bookmark Topic Watch Topic
  • New Topic