aspose file tools*
The moose likes JSF and the fly likes JSF output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF output" Watch "JSF output" New topic
Author

JSF output

Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 106
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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF output