 |
(Updated) JavaServer Faces 1.2 and JavaServer Pages 2.1 Proposed Final Draft Specifications available
Posted by edburns on August 25, 2005 at 05:57 PM | Comments (4)
I'm pleased to announce the availability of the Proposed Final Draft
revisions of the next release of the JavaServerTM Faces and
Pages specifications. The Faces spec may be downloaded from <http://www.jcp.org/en/jsr/detail?id=252>
and the Pages spec may be downloaded from <http://www.jcp.org/en/jsr/detail?id=245>
We really want feedback! Please use our Forum
to share your thoughts on the specs. Or you may send feedback to
the comments alias for Faces or JSP (jsr-252-comments@jcp.org and jsr-245-comments@jcp.org respectively) .
In this entry, I link to a comprehensive high level outline of the
changes to the spec since the 1.1 release of the Faces spec. I've
decided include changes present in the December
Early Draft Release, the April Public
Review Release and the current Proposed Final Draft release for
completeness. As such, this entry repeats some information from my
blog entry on the April Public Review Release. If you're looking
for what's new since that the Public Review release only, please consult
this
issue tracker query.
Keep in mind this is a high level outline, for details, I
encourage you to read the relevant sections of the spec itself.
Before we get to the outline, here is a brief summary of the main
changes:
Unified EL
The expression language used in Faces, which
was inspired by the expression language used in
JSTL and JSP, has been generalized and extracted
into its own top level javax.el
package. The EL is agnostic of the technology
hosting it, such as JSP or Faces, and is intended
to be generally useful in the same way one can use
OGNL in a variety of applications. Faces now has
deprecated its internal EL in favor of using the
Unified EL.
New Tree Creation and Content Interweaving
Model for Faces applications that use JSP
While it is perfectly acceptable to use Faces
without using JSP, many people find their
productivity increases when using these two
technologies together. Unfortunately, as amply
documented by Hans
Bergsten in his article at onjava.com, there
were some integration cases that didn't work as
expected. By changing the specification of the
implementation of the Faces ViewHandler for JSP,
as well as changing the JSP custom tag base class
used by all Faces component tags, these problems
have all been resolved.
Integration with JSTL
Another long standing problem was in using JSTL's
<c:forEach> tag to contain Faces input
components. Because JSP has no notion of a postback, it was
not possible to apply the values correctly to the nested input
components on postback. By introducing some new concepts into
the EL, it is now possible to fully use
<c:forEach> with any kind of Faces
component. This will require a new release of JSTL, which
will also be present in J2EE 5, along with Faces and JSP.
Back Button issues and Multi Frame or Multi Window
Faces Apps
Due to a deficiency in the State Management API using Faces
in Multi Frame or Multi Window applications presented some
problems. The browser back button also could cause
application state to become confused. These problems have now
been fixed.
Associating a message with a particular component in
the page.
Previous revisions of the spec didn't allow for
dynamically including the label of a component in an error
message for that component. New spec features now allow for
this to happen.
It is now possible to override the conversion or
validation message that is displayed to the user on a
per-instance basis. For example:
<h:inputText value="#{bean.value}"
requiredMessage="#{bundle.requiredMessage}"
converterMessage="#{bundle.converterMessage}"
validatorMessage="#{bundle.requiredMessage}">
<f:validateLongRange maximum="1" minimum="10"/>
</h:inputText>
AJAX support
As you should all know by know, AJAX is mainly a
component thing, but there are some things the basic JSF
framework can do to make things a little easier for those
writing AJAXian JSF components. Even without these features
(ie, in JSF 1.1), it's
very easy to write AJAX components for JSF and easier
still to use them.
Specify that the FacesServlet should look
for an init-param called
javax.faces.LIFECYCLE_ID to identify the Lifecycle to be
used for processing this request. This approach allows you
to map different instances of the FacesServlet
with different lifecycles. For example, one mapping for
standard JSF requests and another for AJAX JSF requests.
Specify the name of the state saving parameter so that
AJAX scripts can manually post back the state to the server
using XMLHttpRequest, therefore enabling the AJAX processing
code to have access to the full view. This approach was
used in the Progress
Bar JSF component. The name of the parameter is
javax.faces.ViewState.
Expose an application wide ResourceBundle to the EL.
We have added a new <resource-bundle> element to
the faces-config that allows you to list zero or more
resource bundles that should be exposed to the EL using the
new ELResolver chain. Doing this allows performance
optimizations that prevent the need to create a
ResourceBundle for every request.
API classes use generics
In response to strong Expert Group demand, we have
applied Java SE 5.0 Generics to the JSF api. Therefore, the
minimum JDK requirement for JSF 1.2 is Java SE 5.0. I'm
told that it's possible to retroweave a binary to make it
run under 1.4, but of course that configuration is not
supported or recommended by Sun.
All of these features and more are currently available in the JSF
implementation found in Sun's Open Source Appserver, glassfish.
Now, the outline of changes is available here.
Technorati Tags: edburns
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Ed,
What about the Java SE requirements? Hasn't it changed to Java SE 5 (a.k.a Tiger)?
-- Felipe
Posted by: felipeal on August 25, 2005 at 08:31 PM
-
Sounds great Ed,
Can the glassfish JSF implementation be decoupled and used with Tomcat?
Keep up the great work,
--John
Posted by: johnreynolds on August 26, 2005 at 06:23 AM
-
Is it possible to pass localized label when associating a message with a particular component in the page?
Is it possible to localize standard conversion or validation message in single place, as it was in JSF 1.1? See http://www.jsf-faq.com/faqs/faces-messages.html#126 for example.
Thanks!
Posted by: avalez on October 28, 2006 at 02:29 PM
-
A> Is it possible to pass localized label when associating a message
A> with a particular component in the page? Is it possible to localize
A> standard conversion or validation message in single place, as it was
A> in JSF 1.1? See http://www.jsf-faq.com/faqs/faces-messages.html#126
A> for example. Thanks!
Yes, the above example from JSF-FAQ.com should still work in JSF 1.2.
However, in addition, there is another way to do it in a per-component
manner, as you seem to be requesting. Here's how.
Know that in JSF 1.2, in addition to the f:loadBundel tag, it is
possible, and indeed recommended, to declare the supported locales,
and resource-bundles to go along with them, in the faces-config file.
Given 1, each component in JSF 1.2 has a validatorMessage and
converterMessage property that can be set on a per-component basis to
an arbitrary value from the EL. This value can come from a bundle
loaded via f:loadBundle, or from one defined at the application level
from faces-config.
Posted by: edburns on October 30, 2006 at 10:42 AM
|