Getting the Most from the Java BluePrints Solutions Catalog


NetBeans IDE provides a unique capability for learning and understanding best practices for Java application development with its integration of the Java BluePrints Solutions Catalog. The Java BluePrints Solutions Catalog has long been accepted as the source of Java application best practices and Java suggested guidelines. The Java BluePrints Solutions Catalog also illustrates these best practices and guidelines through various example applications. It provides a huge repository of example applications from which you can literally cut and paste source code or tailor code for your own specific application.

In NetBeans IDE, you can directly access the catalog and install example Java BluePrints Solutions directly into the IDE as a new project. This feature provides you a unique opportunity to learn and understand quickly various Java BluePrints best practices and recommended guidelines.

The Java BluePrints Solutions Catalog is updated on an ongoing basis with new updates available for the IDE through the IDE's Update Center (choose Tools | Update Center).


In the NetBeans IDE 5.0 release, the following Java BluePrints Solutions are available, grouped into three categories:

  • AJAX

    • Using JSF with AJAX

    • Auto-Completion

    • Auto-Completion using a JSF component

    • Progress Bar

    • Progress Bar using JSF

    • Realtime Form Validation

  • Web Tier Design

    • Making Web Applications Accessible

    • Handling Command Submissions

    • Creating Tabbed View

    • Storing Session State on the Client

    • Server-side Validation

    • Client-side Validation

  • Web Services Design

    • Accessing Web Services From J2EE Components

    • Accessing Web Services From a Stand-alone Java Client

    • Designing Document Oriented Services

    • Using xsd:any to Represent XML Documents in a Service Interface

    • Using xsd:anyType to Represent XML Documents in a Service Interface

    • Using Attachments to Represent XML Documents in a Service Interface

    • Using Schema-defined Types to Represent XML Documents in a Service Interface

    • Using Strings to Represent XML Documents in a Service Interface

    • ServiceLocator for Web Services Clients

Accessing the Java BluePrints Solutions Catalog

When you install NetBeans IDE, the Java BluePrints Solutions Catalog is available without any additional installation steps. You can access the catalog by choosing Help | Java BluePrints Solutions Catalog. The catalog is displayed in the IDE's main document area (where the Source Editor also appears) as shown in Figure 10-3.

Figure 10-3. Java BluePrints Solutions Catalog in NetBeans IDE main window


Navigating the Java BluePrints Solutions Catalog

Because the Java BluePrints Solutions Catalog displayed in the NetBeans IDE main window follows the browser paradigm, it is easy to navigate. You will notice a drop-down list from which you can select different Java BluePrints solutions (see Figure 10-4).

Figure 10-4. Java BluePrints Solutions Catalog with the combo box listing the different solutions available


The solutions are grouped into categories, within which you can navigate by clicking the Back or Forward buttons. You can also use the drop-down list to select a specific solution within a category. When a specific Java BluePrints Solution is selected, there are three tabs to choose among, as shown in Figure 10-5.

Figure 10-5. A blueprint with the Solution tab selected


The Solution tab displays a description of the issue the Java BluePrints Solution is trying to solve. The Design tab describes the design of the solution so you can understand the implementation decisions made and the design best practices used in the solution. The Example tab allows you to install an example implementation of the Java BluePrints Solution in NetBeans IDE as a NetBeans project.

To view the solution, design or install an example as a NetBeans project for a given Java BluePrints Solution, simply select the appropriate tab.

Creating an example project is a very useful capability, because it allows you to see a running, working example implementation of the Java BluePrints Solution by being able to run or even debug the solution. In addition, it is very easy to pull source code from a working implementation into your own specific application or project.

Creating a NetBeans Project from a Java BluePrints Solution

This section describes the steps for installing a Java BluePrints Solutions example in NetBeans IDE as a NetBeans project. In addition, the section describes how to run the example once it is installed as a NetBeans project.

To install a Java BluePrints Solution from the Java BluePrints Solutions Catalog:

  1. Choose Help | BluePrints Solutions Catalog.

  2. Once the catalog is displayed, select the solution you want to work with from the drop-down list in the display.

  3. In the solution you have selected, click the Example tab. You will see a screen that looks similar to Figure 10-6.

    Figure 10-6. A solution with its Example tab selected

  4. On the Example screen for the solution, click the Install Example button.

    This will begin the installation and setup of a new NetBeans IDE project for the selected Java BluePrints Solution. The IDE's New Project wizard is launched with the Java BluePrints Solution you have chosen to install selected as the project. For example, the Auto-Completion using a JSF component project template would be chosen (as shown in Figure 10-7) if you clicked Install Example in the screen for the AJAX Auto-Completion using a JSF component solution.

    Figure 10-7. New Project wizard with a Java BluePrints Solution selected

  5. Click the Next button to continue the installation and setup of the Java BluePrints Solution.

  6. The next screen of the wizard asks you to supply a project name (or to accept the default name) and a project location (or to accept the default) and asks whether to set this as the main project in NetBeans IDE.

    In almost all cases, you should accept the defaults shown in the wizard. Only if you want to change the name or location of the project or set it as the main project should you change the default settings displayed in this wizard.

  7. Click the Finish button to complete the installation and setup of the Java BluePrints Solution as a NetBeans IDE project.

    After completing the wizard, you might see the warning dialog box shown in Figure 10-8. This generally occurs if you do not have the Sun Java System Application Server registered with the IDE. It is possible to set the project to work with a different server (such as Tomcat), but some of the features in the application might not work if the server is not fully J2EE 1.4 compliant.

    Figure 10-8. Warning dialog box that appears if the IDE does not detect an appropriate server for the project

    If you see the warning dialog box, follow the instructions it gives. After clicking OK to close the dialog and open the project, right-click the newly created project in the Projects window and choose Resolve Missing Server Problem. The Resolve Missing Server Problem dialog box (shown in Figure 10-9) appears.

    Figure 10-9. Resolve Missing Server Problem dialog box

  8. In the Resolve Missing Server Problem dialog box, select a target server. If you have a Sun Java System Application Server, JBoss Application Server, or BEA WebLogic Application Server installed with NetBeans IDE, you will see options for selecting Sun Java System Application Server, JBoss Application Server, WebLogic Application Server, and Tomcat. Choose the desired server for your project and click OK.

If you would like to use the Sun Java System Application Server, JBoss Application Server, or WebLogic Application Server with the Java BluePrints Solution you are installing, but the server does not appear in the list of servers in the Resolve Missing Server Problem dialog box, click Cancel to exit the dialog box.

If necessary, download and install the application server. Then register the application server in the IDE's Server Manager (available through the Tools menu). After that, you can go back to the Resolve Missing Server Problem dialog box and select the application server you wish to use as the target server.


Once you have the Java BluePrints Solution created as a NetBeans IDE project, you can perform operations such as building, deploying, and debugging.

You can also install the available Java BluePrints Solutions as IDE projects straight from the New Project wizard. In the New Project wizard, you can expand the Sample folder category to show BluePrints Solutions folder. The BluePrints Solutions folder contains the same Java BluePrints Solutions as the ones in the catalog that have an Example tab.


Running a Java BluePrints Solutions Project

To run a NetBeans IDE project that has been created from the Java BluePrints Solutions Catalog, you perform the same operations as you would when running other Java EE applications in the IDEthat is, you open the Projects window, right-click the newly created project for your Java BluePrints Solution, and choose Run Project. NetBeans IDE will build the newly created Java BluePrints Solutions project, deploy it to the target server, and load the application's home page in your default web browser automatically.

Once you have the Java BluePrints Solution created as a project in NetBeans IDE, you can perform a large number of operations. For example, you can deploy the application to your target server, as you have already seen; you can run the application in a debugger; you can use the HTTP Monitor to analyze the HTTP requests that are passed between your browser and the deployed application; and you can make changes to the source files by editing the project source.

In fact, using the Java BluePrints Solutions Catalog and one of its applications is an excellent way to learn some of the Java EE technologies and best practices on how to use the technologies. In addition, these solutions are an excellent source from which you can cut and paste code for an application you are developing.



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net