FeaturesPluginsDocs & SupportCommunityPartners

JSF Support UI Specification

Author: Petr Pisl

$Revision: 1.3 $
$Date: 2005/08/31 16:03:51 $

Topics:

Use Cases and Scenarios

Adding JSF capabilities to the web project

Extending a web project with Java Server Faces (JSF) includes copying of JSF JAR files and configuration files, changing deployment descriptor and set up the JSF to ready for development.
There are two ways how to add the JSF into a web projects:

  1. During creation of a new Web Application. The user is able to add JSF support neither during creating new Web Application with Existing Sources nor creating new Web Application with existing Ant Script.
  2. When a web project already exist.
Scenario 1 - Creating new Web Application with JSF support:
  • Choose New Project -> Web -> Web Application
  • Name and Location Panel - without changes
  • Adding Capabilities - choose the JSF 1.0.1
  • Configure the JSF support in the JSF support panel
  • Finish
Scenario 2 - Adding JSF support into already existing Web Application
  • Choose the Web Application in the Project view -> go to the Project Properties
  • Choose the Frameworks node. See here.
  • Click on Add button and choose the JSF from the dialog.
  • The JSF support panel is displayed in the customizer.

Specification

New Web Application Wizard - JSF Support

Figure: Shows default value for adding JSF in new Web Application wizard

            +---------------------------------------------------------------------+
            |                                                                     |
            | JSF Servlet Name:         |_Faces Servlet______________________|    |
            | JSF URL Pattern:          |_/faces/*_________________________v_|    |
            |                                                                     |
            | [x] Validate XML          [ ] Verify Objects                        |
            |                                                                     |
            +---------------------------------------------------------------------+
        

Components:

  • JSF Servlet Name - name of the JSF servlet. Default value: Faces Servlet
  • JSF URL Pattern - how the JSF servlet will be mapped. Editable list box with predefined value /faces/*.
Error Conditions:
  • JSF Servlet Name, JSF URL pattern.

Panel in the customizer

The panel for the customizer is almost the same as the panel for new Web Application Wizard.

Figure: Panel, which is displayed in the Project Customizer.

            +-------------------------------------------------------------------+
            |                                                                   |
            | JSF Servlet Name:         |_Faces Servlet______________________|  |
            | JSF URL Pattern:          |_/faces/*_________________________v_|  |
            |                                                                   |
            | [x] Validate XML          [ ] Verify Objects                      |
            |                                                                   |
            +-------------------------------------------------------------------+
        

Wizards

New Managed Bean

The wizard creates new appropriate managed bean java class end put the definition in the configuration.

Figure: Panel for basic declaration of new managed bean.

            +-----------------------------------------------------------------------------------+
            | New Managed Bean Class                                                            |
            +-----------------------------------------------------------------------------------+
            | Name and Location                                                                 |
            | --------------------------------------------------------------------------------- |
            |                                                                                   |
            | Class Name:   |_ManagedBean____________________________________________________|  |
            |                                                                                   |
            | Project:      |_UserApplication________________________________________________|  |
            | Location:     |_Source Packages _____________________________________________v_|  |
            | Package:      |______________________________________________________________v_|  |
            | Created File: |_/UserApplication/src/java/XX.java______________________________|  |
            |                                                                                   |
            | --------------------------------------------------------------------------------- |
            |                                                                                   |
            | Configuration File:  |_/WEB-INF/faces-config.xml_____________________________v_|  |
            | Scope:               |_request_______________________________________________v_|  |
            | Bean Description:    +---------------------------------------------------------+  |
            |                      |                                                         |  |
            |                      |                                                         |  |
            |                      |                                                         |  |
            |                      +---------------------------------------------------------+  |                                                             |
            |                                                                                   |
            |                               [ Back ] [ Next> ] [[ Finish ]] [ Cancel ] [ Help ] |
            +-----------------------------------------------------------------------------------+
        
Components:
  • Configuration File - JSF configuration file, where the new ManagedBean will be defined. This listbox contains all JSF configuration files in the working project.
  • Scope - not editable combobox where are these values:
    • request (default)
    • session
    • application
    • none
  • Bean Description - text area
  • Next - disabled
  • Finish - default value
Error Conditions:
  • Configuration File - must be selected
  • Class Name and Location - part of standard Java class wizard with its error conditions

Add Managed Bean Dialog

The Dialog is accessible through the context menu in editor for JSF configuration file. Includes elements with definition of a Managed Bean.

Figure: Shows dialog for entering new Managed Bean element to the JSF configuration file

            +-------------------------------------------------------------------+
            | Add Managed Bean                                                  |
            +-------------------------------------------------------------------+
            |                                                                   |
            | Bean Name:        |_______________________________|               |
            | Bean Class:       |_______________________________| [ Browse... ] |
            | Scope:            |_request_____________________v_|               |
            | Bean Description: +-------------------------------+               |
            |                   |                               |               |
            |                   |                               |               |
            |                   |                               |               |
            |                   +-------------------------------+               |
            |                                                                   |
            |                                                                   |
            |                                     [[ Add ]] [ Cancel ] [ Help ] |
            +-------------------------------------------------------------------+
        
Components:
  • Bean Class - the button Browse opens dialog for finding the class.
  • Scope - not editable combobox where are these values:
    • request (default)
    • session
    • application
    • none
  • Bean Description - text area
Error Conditions:
  • Bean Name has to be entered
  • Bean Class has to be entered

Add Navigation Rule Dialog

The Dialog is accessible through the context menu in editor for JSF configuration file. Includes new definition of navigation-rule element.

Figure: Shows dialog for entering new Navigation Rule.

            +----------------------------------------------------------------------+
            | Add Navigation Rule                                                  |
            +----------------------------------------------------------------------+
            |                                                                      |
            | From View:           |_______________________________| [ Browse... ] |
            | Rule Description:    +-------------------------------+               |
            |                      |                               |               |
            |                      |                               |               |
            |                      |                               |               |
            |                      +-------------------------------+               |
            |                                                                      |
            |                                                                      |
            |                                        [[ Add ]] [ Cancel ] [ Help ] |
            +----------------------------------------------------------------------+
        
Components:
  • From View - the Browse... button opens an file browse dialog, where the Web Pages folder is the root.
  • Rule Description - text area
Error Conditions:
  • From View - there should be only one rule for one file.
  • From View has to be entered.

Add Navigation Case Dialog

The Dialog is accessible through the context menu in editor for JSF configuration file. Includes new definition of navigation-case element. When the dialog is invoke, when the cursor is inside a navigation rule, then the navigation rule is used as default.

Figure: Shows dialog for entering new Navigation Case.

            +----------------------------------------------------------------------+
            | Add Navigation Case                                                  |
            +----------------------------------------------------------------------+
            |                                                                      |
            | From View:           |_____________________________v_| [ Browse... ] |
            | -------------------------------------------------------------------- |
            | From Action:         |_______________________________|               |
            | From Outcome:        |_______________________________|               |
            | To View:             |_____________________________v_| [ Browse... ] |
            | [ ] Redirect                                                         |
            | Case Description:    +-------------------------------+               |
            |                      |                               |               |
            |                      |                               |               |
            |                      |                               |               |
            |                      +-------------------------------+               |
            |                                                                      |
            |                                                                      |
            |                                        [[ Add ]] [ Cancel ] [ Help ] |
            +----------------------------------------------------------------------+
        
Components:
  • From View - this is editable combobox. The values are taken from the configuration files (the value of from-view-id in navigation-rule). When the dialog is invoke, when the cursor is inside a navigation rule, then the default value is the value of from-view element of this navigation rule. The Browse... button opens an file browse dialog, where the Web Pages folder is the root. If there is no navigation rule for such file, then new navigation rule is created as well.
  • To View - this is editable combobox. The values are taken from the configuration files (the value of from-view-id in navigation-rule). The Browse... button opens an file browse dialog, where the Web Pages folder is the root.
Error Conditions:
  • From View has to be entered
  • From Action or From Outcome has to be entered
  • To View has to be entered

JSP Editor

JSF Code Completion in JSP Editor

TBD

JSF Dynamic Help in JSP Editor

When user uses code completion for the JSF tags and their attributes, there is shown help in Javadoc popup window. Like for html tags.

JSF Hyperlink in JSP Editor

When user edits a jsp file and uses JSF tags, it's very useful to provide hyperlink for faster navigation between the jsp files and appropriate JSF files, application resources etc.
Tag Attribute Where
TBD

Editor for JSF Configuration File

Contextual Menu in JSF Configuration File

The contextual menu is taken from the XML Editor, but the dialogs for adding elements should be accessible through this menu and there should be action for validation of the file.

Contextual Menu:

            JSF             >
            Select in       >
            Cut            CTRL-X
            Copy           CTRL-C
            Paste          CTRL-V
            Reformat Code  CTRL-SHIF-F
            Check XML      ALT-F9
            Validate XML   ALT-SHIFT-F9
            Tools
        
Contextual JSF SubMenu:
            Add Managed Bean
            Add Navigation Rule
            Add Navigation Case
        

Code Completion in JSF Configuration File

TBD

Hyperlink in JSF Configuration File

The JSF configuration file can be large and it's useful to have way how to quickly navigate between a definition of an element and using the elements.

Element Attribute Where
managed-bean-class   the appropriate java file
from-view-id   the appropriate resource file
to-view-id   the appropriate resource file

Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by