NetBeans 73 JSF22

Revision as of 14:03, 15 June 2012 by Marfous (Talk | contribs)

List of JavaServer Faces 2.2 features vs. NetBeans IDE support


Contents


Introduction

Since JavaServer Faces specification in version 2.2 should be completed during NetBeans 7.3 development phase including its support from the GlassFish application server, we should be able to implement support for features of this JSF release.

In following section should be mentioned all known JSF features which should be "IDE support-able" and suggestions for them - like difficultness and feature suggestions.

Be aware that the JSF 2.2 specification is still changing and many of described features could work differently or some of features could be added/removed in addition. Also two the biggest features weren't specified yet, so especially multi-templating support is just guessed from the prototype application.

Time consumption and usefulness expectations
There is attempt to guess time consumption and usefulness of the proposed suggestions. Here are explanatory notes to them:

  • EASY - should take 1/2 - 1 day
  • MODERATE - should take 1 - 3 days
  • COMPLEX - complicated feature which has to be designed detaily (time depends on the desing)
  • UNKNOWN - can be estimated by the feature author
  • OPTIONAL - looks not too much useful
  • NICE_TO_HAVE - looks like great feature
  • AUTO - it should work automatically - by updating the library or taglib definition files, etc.

Open Questions

  • Which JSF libraries will we bundle with NetBeans IDE? 2.2, 2.1, 1.2?
  • There are almost no information about JSF 2.2 and HTML5 support (what everything we could expect)
  • Multi-templating was created just like prototype for now so hard to guess what everything will be needed to support

Mandatory IDE updates

  • Update model of faces-config.xml for JSF2.2
  • Bundle JavaServer Faces library 2.2
  • Update NetBeans sources to be able to handle one-file JSF library .JAR (jsf-api.jar and jsf-impl.jar was merged into javax.faces.jar)

JSF 2.2 features which can be supported in IDE

Faces Flow

Description/Example: In web applications, and in applications in general actually, there is often the concept of a “flow” that takes the user through a series of screens. Such flows includes wizards, multi-screen subscriptions, bookings, etc.

  • Base Support: @FlowScoped anntotaion, new tablib "xmlns:j="http://java.sun.com/jsf/flow"" should be working by deafult???, as well as new j:<coponents>???
  • Suggestion #1: EL should have new implicit variable in CC: facesFlowScope (EASY & NEEDED)
  • Suggestion #2: Wizard - Create new FacesFlow: It would help to create skeleton for new faces-flow: create FF folder (by convention), ask for steps pages, not sure how much would be possible to define whole faces-flow-definition, see http://jdevelopment.nl/jsf-22/#730 (COMPLEX & NICE_TO_HAVE)
  • Suggestion #3: Hint - CDI not enabled (at @FlowScoped or j:<component> or taglib usage?) when the CDI is not enabled since JSF 2.2 is dependend on CDI here (MODERATE & NICE_TO_HAVE)
  • Suggestion #4: EL Faces-Flow CC - i.e. #{facesFlowScope.someKey} someKey variable could be available across rest pages of the same flowScope (UNKNOWN & NICE_TO_HAVE)

More information: http://javaserverfaces-spec-public.java.net/nonav/proposals/JAVASERVERFACES_SPEC_PUBLIC-730/proposal.txt

Multi-Templating

DRAFT - not enough of information to design it preciselly
Description/Example: Give to a JSF application, the ability to change its look and feel with the use of several templates,

  • Base Support: User is able to create folder for templates and define context-param in the web.xml DD by himself.
  • Suggestion #1: Facelets Template wizard checkbox "Use multi-templating" - it would set required name of the page and parent folder (templates) and the user could choose just the name of the template (subfolder) (MODERATE & NICE_TO_HAVE)
  • Suggestion #2: In addition to suggestion #1 the wizard would generate whole template skeleton, means: <template>/css, <template>/images, <template>/defaultPng.png, <template>/template.xhtml, <template>/template.xml (with generated base meta informations) (MODERATE & NICE_TO_HAVE)
  • Suggestion #3: Layout style should be possible to turn off (using checkbox) - to be able to create only simple empty template skeleton (in combination with the checkbox from suggestion #1) (EASY & NICE_TO_HAVE)
  • Suggestion #4: If multi-template chosen, we could enable checkbox "use as default" which would update web.xml DD and the appropriate context-param (EASY & NICE_TO_HAVE)

More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-971

Facelets Component Tag can be declared via annotation

Description/Example: Facelets does not require an explicit tag handler and a component can be registered via its annotation.

  • Base Support: new parameters of @FacesComponent will be offered by Java code completion
  • Suggestion #1: JSF model should be able to load @FacesComponent and JSF Editor should offer these components in CC, including namespace handling (COMPLEX & NICE_TO_HAVE)

More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-594

Facelets ResourceResolver can be declared via annotation

Description/Example: Instead of registering resource resolved in web.xml DD using javax.faces.FACELETS_RESOURCE_RESOLVER @FaceletsResourceResolver can be used.

Base Support: Provide annotation for declaring Facelets ResourceResolver (AUTO)

  • Suggestion #1: Hint at the FaceletsResourceResolver if more annotation like this is used that just the first encountered one will be used (MODERATE & OPTIONAL)

More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1038

Component and validator annotations default to simple class name

Description/Example: @FacesComponent and @FacesValidator value attribute becomes optional.

Base Support: value is an optional attribute now - should be handled by java editor (AUTO)

  • Suggestion #1: Hint at the annotation with value which correspond to the class simple name with decapitalized first letter that the value is optional now and can be removed (EASY & NICE_TO_HAVE)

More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-703

JSF 2.2 features which are/will be supported automatically

The viewAction Component

Description/Example:

<f:metadata>    
    <f:viewAction action="#{someBean.someAction}" />
</f:metadata>

Base Support: new <f:viewAction> component (AUTO)
More information: http://www.oracle.com/technetwork/articles/java/jsf22-1377252.html

Queue control for AJAX requests

Description/Example: Delay attribute of the <f:ajax> tag can specify AJAX requests queue behavior.

Base Support: new delay attribute at <f:ajax> component (AUTO)
More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1050

AJAX + non-AJAX file upload component

Description/Example: New component for uploading files.

Base Support: new <f:fileInput> component (AUTO)
More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-802, http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1062

Injection in all JSF artifacts

Description/Example: Almost all JSF artifacts can be used as injection target.

Base Support: @EJB, @Inject, ... annotation can be added into Validators, Converters etc. already now, CallEJB actions works also in all java classes of web project (AUTO)
More information: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-763

Other JSF 2.2 features

Here are lists of rest JavaServer Faces 2.2 features which are improvments in the JSF itself and doesn't require any support from the IDE or supports from NetBeans would be quite non-conceptual and such supports aren't available also in another areas (like i.e.: detecting faces-config created nodes programatically, support for beans CC by programatically building facelet etc). All features defining new annotations, new faces-config.xml tags, new objects, methods, properties, const will be supported by default by XML or Java editor as usually.

Java APIs

  • Programmatic configuration
  • FaceletFactory in the standard API
  • FlashFactory and FlashWrapper
  • Instantiating composite component in Java
  • Support for the Collection interface in UIData
  • Wrapper class for Lifecycle

Lifecycle

  • Identify client windows via a Window Id (ide does not provide completion for context-param names and values)
  • Restoring view scope before view is build
  • System events for The Flash
  • Publish PostRestoreStateEvent
  • Mandate tree visiting for partial state saving

Components

  • Component modification management

XML configuration

  • Case insensitivity for state saving method (ide does not provide completion for context-param names and values)

Standards compliance

  • Unique ids and fixed name attribute for view state field
  • Allowing id attribute on all elements for HTML5 content (id can be specified for all components)

Useful links

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo