About Web Application FrameworksSun's JavaServer Faces (JSF) technology (JSR-127) is the standard Java API for building user interface components in web applications. JSF defines a component-based web application framework, enabling vendors and open source projects to create sophisticated user-interface widgets that you can then develop to create easy-to-use web applications, with portability between tools and application servers. Its list of features is as follows:
- Standard component API for user interface components. The range is from simple input fields to more complex tree controls and menus, to sophisticated scrollable tables which allow both input and output. Components also support standard JavaBeans style events and event listeners.
- Decoupled rendering model. The same component can be rendered in different ways, for example, a command component used to submit a form can be rendered as either a button or a hyperlink.
- Request processing lifecycle. The lifecycle focuses on the handling of user interface events (such as the node of a tree control being expanded or contracted), coupled with support for data type conversions and component level validation rules.
- Utility technologies supporting the component APIs. This includes value binding and method binding expressions, managed beans (create on demand), and page navigation support.
JSF also includes the Visual Web JavaServer Faces framework, enabling drag and drop functionality and providing a more visual approach to web application design.
For a complete description of the JSF framework, including documentation and tutorials, see:
http://java.sun.com/javaee/javaserverfaces/index.jsp The IDE provides sample applications that make use of JSF technology. Press Ctrl-Shift-N, expand the Samples folder, the Java BluePrints Solutions folder, and the Web Tier with JavaServer Faces Technology folder. Select any sample, click Next, and then click Finish. The sample opens in the IDE.
Other web application frameworks are available. They can be integrated with the IDE just as easily as the JSF technology. Two of the more popular alternative web application frameworks are as follows:
When you use the IDE to add the framework's tag libraries in your web application's WEB-INF/lib folder, and the JSP file has taglib directives with URIs for the parts of the libraries that you are using, the Source Editor provides code completion for these libraries.
Creating a New Application with JSF SupportSun's JavaServer Faces (JSF) technology (JSR-127) is the standard Java API for building user interface components in web applications. JSF also includes the Visual Web JavaServer Faces framework, enabling drag and drop functionality and providing a more visual approach to web application design.
The JSF tag libraries and supporting files are bundled with the IDE.
To create a new web application with JSF support:- Choose File > New Project (Ctrl-Shift-N).
- From the Web category, select Web Application.
- Continue with the wizard until you reach the Frameworks panel. Select JavaServer Faces or Visual Web JavaServer Faces and click Finish. The new project opens in the IDE.
After you create a web application with JSF support, you can use the New JSF Managed Bean Wizard.
Creating a New Web Application with Spring MVC Framework SupportThe Spring framework libraries and supporting files are bundled with the IDE.
To create a new web application with Spring Web MVC support:- Choose File > New Project (Ctrl-Shift-N). The New Project wizard displays.
- Under Categories select Web, then under Projects, select Web Application. Click Next.
- Continue through the wizard to Step 4, the Frameworks panel, and select Spring Web MVC 2.5.
- Under Spring Web MVC 2.5 Configuration, specify the dispatcher name and mapping you want to use in the application. Click Finish.
- The JSTL library version 1.1, is bundled by default with the web application. To exclude JSTL, in the Frameworks panel click on the Libraries tab and deselect the Include JSTL option.
- Dispatcher mappings are based on the Java Servlet Specification Section SRV.11.2 [add link?]. In the web application deployment descriptor, the following syntax is used to define standard mappings:
- A string beginning with a '/' character and ending with a '/*' postfix is used for path mapping.
- A string beginning with a '*.' prefix is used as an extension mapping.
- A string containing only the '/' character indicates the default servlet of the application. In this case the servlet path is the requested URI minus the context path and the path info is null.
- All other strings are used for exact matches only.
Creating a New Application with Struts SupportThe Struts tag libraries and supporting files, such as the struts-config.xml file, are bundled with the IDE.
To create a new application with Struts support:- Choose File > New Project (Ctrl-Shift-N).
- From the Web category, select Web Application.
- Continue with the wizard until you reach the Frameworks panel. Select Struts and click Finish. The new project opens in the IDE.
After you create a web application with Struts support, you can use the New Struts Action Wizard and the New Struts ActionForm Bean Wizard.
-- Wagner R. Santos