component rendering model

G

gk

JSF provides component rendering model.


Here I'm studying this example:

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
<html>
<head><title>jsf h:commandButton example</title></head>

<body>
<h:form>
<h:commandButton value="Go To Index Page."
action="page1" />
</h:form>
</body>
</html>
</f:view>

Is it because JSF provide component rendering model , so the html
button is visible in display ?

Is not JSTL also provide a similar kind of component rendering
model ? it also has a <c:eek:ut to help printing out the display.
 
L

Lew

gk said:
JSF provides component rendering model.


Here I'm studying this example:

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
<html>
<head><title>jsf h:commandButton example</title></head>

<body>
<h:form>
<h:commandButton value="Go To Index Page."
action="page1" />
</h:form>
</body>
</html>
</f:view>

Is it because JSF provide component rendering model , so the html [sic]
button is visible in display ?
No.

Is not JSTL also provide a similar kind of component rendering
model ? it also has a<c:eek:ut to help printing out the display.

No, JSTL does not have a component rendering model. It has a
translate-to-HTML model.
 
A

Arne Vajhøj

JSF provides component rendering model.

Here I'm studying this example:

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
<html>
<head><title>jsf h:commandButton example</title></head>

<body>
<h:form>
<h:commandButton value="Go To Index Page."
action="page1" />
</h:form>
</body>
</html>
</f:view>

Is it because JSF provide component rendering model , so the html
button is visible in display ?

The JSF component output the HTML you see client side.
Is not JSTL also provide a similar kind of component rendering
model ? it also has a<c:eek:ut to help printing out the display.

JSTL also outputs HTML.

But JSF components do a lot more than JSTL tags.

Arne
 
L

Lew

How does a component rendering model differ from a translate-to-HTML
model?

JSTL doesn't have components - just tags that have some smarts about what to
emit to the HTML stream, and no relationships or logic models between them. A
component (rendering) model has actual components - a DataTable containing
cells with OutputText or CommandButtons, for example - with their own
behaviors and defined relationships between them, and state that is managed
between visits to the server.

Yes, the component model in JSF winds up writing to HTML - in that they are
similar.
 
G

gk

A component (rendering) model has actual components - a DataTable containing
cells with OutputText or CommandButtons,
for example - with their own
behaviors and defined relationships between them, and state that is managed
between visits to the server.

What behaviors and relationship you are talking about for example ?
 
A

Arved Sandstrom

JSTL doesn't have components - just tags that have some smarts about
what to emit to the HTML stream, and no relationships or logic models
between them. A component (rendering) model has actual components - a
DataTable containing cells with OutputText or CommandButtons, for
example - with their own behaviors and defined relationships between
them, and state that is managed between visits to the server.

Yes, the component model in JSF winds up writing to HTML - in that they
are similar.
Lew, I suspect you know this, but JSF only _typically_ renders HTML. But
pretty much anything that you can jam into a response stream can be
rendered.

AHS
 
L

Lew

Arved said:
Lew, I suspect you know this, but JSF only _typically_ renders HTML. But
pretty much anything that you can jam into a response stream can be rendered.

Very good point. I was staying within the realm of typical use, but you are
absolutely correct.
 
L

Lew

You should think about what a "component" means in GUI development; that will
answer your questions. For example, what is a component in Swing?

Please answer that question in this forum.
What behaviors and relationship you are talking about for example ?

For example, event handlers and containment.

http://lmgtfy.com/?q="What+is+the+Java+JSF+component+model"

http://myfaces.apache.org/core20/myfaces-impl/tlddoc-facelets/index.html
http://download.oracle.com/javaee/5/javaserverfaces/1.2/docs/tlddocs/

http://www.ibm.com/developerworks/s...=dW&searchScope=javaZ&query=JSF&Search=Search
http://www.ibm.com/developerworks/java/library/j-jsf1/ /et seq./
Section "A component-based architecture"
(Ignore that they say "is comprised of" instead of "comprises" - it's a common
ridiculousness.)
http://www.coreservlets.com/JSF-Tutorial/
 
A

Arne Vajhøj

What behaviors and relationship you are talking about for example ?

JSF components are structured in a tree.

The JSF framework does a lot of stuff during request and response
processing.

Arne
 
R

Roedy Green

Is it because JSF provide component rendering model , so the html
button is visible in display ?


To satisfy your curiosity, I suggest you write some simple programs
taken from the examples, and then do a view source in your browser to
see the HTML that gets finally generated.

Nowadays the rendering details could be handled by JavaScript,
Applets, the server, CSS, or one of the HTML variants.
--
Roedy Green Canadian Mind Products
http://mindprod.com
To err is human, but to really foul things up requires a computer.
~ Farmer's Almanac
It is breathtaking how a misplaced comma in a computer program can
shred megabytes of data in seconds.
 
L

Lew

You should think about what a "component" means in GUI development; that will
answer your questions. For example, what is a component in Swing?

Please answer that question in this forum.
 
G

gk

You should think about what a "component" means in GUI development; that will
answer your questions.  For example, what is a component in Swing?

Please answer that question in this forum.



For example, event handlers and containment.

http://lmgtfy.com/?q="What+is+the+Java+JSF+component+model"

http://myfaces.apache.org/core20/my...om/javaee/5/javaserverfaces/1.2/docs/tlddocs/

http://www.ibm.com/developerworks/s...bm.com/developerworks/java/library/j-jsf1//et seq./
Section "A component-based architecture"
(Ignore that they say "is comprised of" instead of "comprises" - it's a common
ridiculousness.)http://www.coreservlets.com/JSF-Tutorial/


Are you trying to say , the JSF component renderer not only just
translate to html view but also does the event handling part also.

For example, a commandButton link is not only just rendered to a html
button but takes of the action when this button is clicked.

The JSF componenent renderer is not just an html-Translator but have
extra responsibilities e.g even handling also which JSTL html
translator does not do.

Is that correct ?
 
L

Lew

Are you trying to say , the JSF component renderer not only just
translate to html view but also does the event handling part also.

For example, a commandButton link is not only just rendered to a html
button but takes of the action when this button is clicked.

The JSF componenent renderer is not just an html-Translator but have
extra responsibilities e.g even handling also which JSTL html
translator does not do.

Is that correct ?

You ask a lot of questions but you didn't answer mine.
 
G

gk

You ask a lot of questions but you didn't answer mine.

Your question was what is a component in Swing . There are many
components in Swing ..e.g Jbutton , radio's , Jlist , checkbox ,
JPanel etc so many GUI elements! ..How you are trying to map these
with the JSF components ?
 
L

Lew

Your question was what is a component in Swing . There are many
components in Swing ..e.g Jbutton , radio's , Jlist , checkbox ,
JPanel etc so many GUI elements! ..How you are trying to map these
with the JSF components ?

I asked what a component is, not what the components are. What does it mean
to be a component in Swing?

It has roughly the same meaning in JSF.

Did you read the articles to which I linked?


http://lmgtfy.com/?q="What+is+the+Java+JSF+component+model"

http://myfaces.apache.org/core20/myfaces-impl/tlddoc-facelets/index.html
http://download.oracle.com/javaee/5/javaserverfaces/1.2/docs/tlddocs/

http://www.ibm.com/developerworks/s...=dW&searchScope=javaZ&query=JSF&Search=Search
http://www.ibm.com/developerworks/java/library/j-jsf1/ /et seq./
Section "A component-based architecture"
(Ignore that they say "is comprised of" instead of "comprises" - it's a common
ridiculousness.)
http://www.coreservlets.com/JSF-Tutorial/

Did you?
 
G

gk

I asked what a component is, not what the components are.  What does it mean
to be a component in Swing?

It has roughly the same meaning in JSF.

Here is what you wanted ..

Swing is a component-based framework. The distinction between objects
and components is a fairly subtle point: concisely, a component is a
well-behaved object with a known/specified characteristic pattern of
behaviour. Swing objects asynchronously fire events, have "bound"
properties, and respond to a well-known set of commands (specific to
the component.) Specifically, Swing components are Java Beans
components, compliant with the Java Beans Component Architecture
specifications.
 
L

Lew

gk said:
Swing is a component-based framework. The distinction between objects
and components is a fairly subtle point: concisely, a component is a
well-behaved object with a known/specified characteristic pattern of
behaviour. Swing objects asynchronously fire events, have "bound"
properties, and respond to a well-known set of commands (specific to
the component.) Specifically, Swing components are Java Beans
components, compliant with the Java Beans Component Architecture
specifications.

Excellent. JSF components have some of the same characteristics, except JSF
components aren't Java Beans. The key point is that components have some
smarts - they're not just simple emitters of text.

That definition is accurate enough in general, but falls slightly short in
specifics for a GUI framework like Swing or JSF. A GUI component is an object
that has intelligence about display matters. It can contain other components,
be contained by another, maintain certain local state such as display style,
and in the case of JSF, engage in various lifecycle behaviors including
passing data back and forth to backing beans.

The component tree (component that contains components that contain ...) is
maintained by the JSF framework independently of the request-response cycle
over HTTP. This allows the GUI parts of a JSF to behave in many ways like
corresponding Swing (or other desktop GUI) components. On top of that, they
live in a tag library that works for web applications. (As Arved noted, "JSF
only _typically_ renders HTML. But pretty much anything that you can jam into
a response stream can be rendered.")

Once you get used to JSF that component nature is a powerful tool. For me I
had to start thinking of JSF as like a normal GUI framework having web smarts
rather than as a web framework /per se/. That led me to structure web pages
as collections of components and helped me keep model and controller aspects
out of my screens.

For your original question, you don't need components to render a command
button. You can use HTML or XHTML. JSTL doesn't have buttons or tables -
it's just some convenience tags over functionality like branching or SQL
access. JSTL doesn't have components, as surely you can see from the definition.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top