54 Developer Tools: Developing JSPs

This chapter contains information about developing WebCenter Sites JSPs with Developer Tools.

This chapter contains the following sections:

54.1 JSP Development with Developer Tools

The Developer Tools kit supports the development of WebCenter Sites JSPs using the native Eclipse JSP editor. The Eclipse JSP editor includes support for WebCenter Sites tag and Java API completion, syntax highlighting, and debugging. Figure 54-1 shows an example of a WebCenter Sites JSP in the Eclipse editor.

Figure 54-1 Eclipse JSP editor

Description of Figure 54-1 follows
Description of "Figure 54-1 Eclipse JSP editor"

WebCenter Sites JSPs can include page caching, resultset caching, and associated metadata such as Template assets, CSElement assets, or ElementCatalog entries. The metadata of a JSP enables WebCenter Sites to track and manage it. Developer Tools handles a JSP's underlying WebCenter Sites processes transparently, including tracking the JSP and its corresponding metadata. If your WebCenter Site instance is running, and you save a JSP in Eclipse, the Developer Tools kit automatically synchronizes those changes with the WebCenter Sites instance. Any metadata associated with the JSP is also synchronized with WebCenter Sites. This enables you to view the changes in WebCenter Sites as soon as you save the JSP in Eclipse.

54.2 Tag and Java API Completion

Eclipse provides tag and Java API completion features. Eclipse uses the tag libraries and jar files belonging to the current WebCenter Sites instance to provide the appropriate code completion for WebCenter Sites related tags and Java APIs. For local hosts, the WebCenter Sites tag libraries and jar files are automatically linked to your Eclipse project, and contained within the Eclipse project folder (located in the "Project Explorer" view). For remote hosts, the WebCenter Sites tag libraries and jar files must be manually copied from the remote host to your Eclipse project. For instructions, see Section 52.2, "Setting Up Developer Tools."

  • The tag libraries are contained in the futuretense_cs folder under the WEB-INF folder.

  • The jar files are contained under the main Eclipse project folder.

    Description of projexp.png follows
    Description of the illustration projexp.png


    When you use the tag and Java API completion feature, keep in mind the following:

    • Make sure you follow strict JSP coding standards. This way your code can be deployed on any application server.

    • Eclipse code completion displays all public Java methods contained within the WebCenter Sites jars, only use the APIs that are in the WebCenter Sites documentation. Using undocumented functionality is risky and unsupported.

Associating the Oracle Fusion Middleware WebCenter Sites Java API Reference and Oracle Fusion Middleware WebCenter Sites Tag Reference with Eclipse enables the tag and Java API completion features to display information about each tag and piece of Java code you use when managing a WebCenter Sites JSP. For example, when you are working with a WebCenter Sites JSP and you begin to type the name of a tag, a window opens listing code completion suggestions. If you associated the Tag Reference and Javadoc with Eclipse, a second dialog box is displayed containing information about each suggestion (see Figure 54-2).

Figure 54-2 Tag and Java API completion feature

Description of Figure 54-2 follows
Description of "Figure 54-2 Tag and Java API completion feature"

In addition to adding functionality to the tag and Java code completion features, the Javadoc and Tag Reference are both made accessible in the "Sites Developer Reference" view. For more information, see Section 53.4.6, "Sites Developer Reference View."

54.3 Debugging

To debug Java and JSP code in Developer Tools, you must first attach the debugger to the JVM process that runs WebCenter Sites. It is recommended to do so with remote debugging. To attach the WebCenter Sites JVM, follow the instructions provided by Eclipse at the following URL:


Once the JVM is attached to the debugger, you can set breakpoints in your JSP and Java code, view variables, and so on.