Using Kelp with an IDE
This chapter describes how to use Kelp to develop applications with XMLC for use with Lutris EAS. It assumes that you have a basic understanding of Lutris EAS and either SunTM ForteTM for JavaTM, Community Edition or Borland® JBuilder.
Kelp is a set of tools that extend a Java integrated development environment (IDE) to simplify the development of applications for Lutris EAS.
Kelp for Forte is a set of tools for Sun Forte for Java, Community Edition. For information on Forte for Java, visit the Sun Forte for Java website at: http://www.sun.com/forte/ffj/.
Kelp for JBuilder is a set of tools for Borland JBuilder. For information on JBuilder, visit the Borland website at: http://www.borland.com/jbuilder/.
Note: Kelp for Forte and Kelp for JBuilder function very similarly. For the sake of clarity, this chapter is written for one IDE, Forte for Java, Community Edition. Any notable differences for Kelp for JBuilder are addressed in a separate section at the end of this chapter.
Kelp features
Kelp provides the following tools and features:
The Kelp Application Wizard generates Web or wireless applications using either the Servlet API or the Enhydra Application Framework (EAF) programming model. Additionally, the Kelp Application Wizard generates Enhydra Services.
The Kelp XMLC tool lets you set XMLC options, select markup language files (for example, HTML, WML, cHTML, or XHTML) to compile, and call XMLC from within the IDE to create classes that generate Web or wireless content dynamically.
The Kelp Deployer allows you to set up your project properties, copy static content to the document root, process templates, create deployable archives, and deploy the archives.
The Import wizard allows you to import Enhydra projects that use GNU Makefiles into your IDE. The Import Wizard is currently supported in JBuilder only.
Customizers (Forte) and property pages (JBuilder) allow you to edit XMLC properties, giving you full control over how XMLC builds Document Object Model (DOM) classes from your HTML files. XMLC works with other markup languages, including WML, cHTML, and XHTML.
Customizers (Forte) and property pages (JBuilder) allow you to edit Input Templates, specifying a list of strings to search and replace when you are generating files from templates.
Through property pages, you can set up JBuilder to invoke XMLC and the Kelp Deployer whenever you make or rebuild your JBuilder project. This feature lets you quickly ensure that your files are updated without having to run the tools individually.
Note: Build integration is not currently supported by Kelp in Forte. To build Lutris EAS projects with Kelp in Forte, you must invoke the Kelp XMLC tool before building the project, and the Kelp Deployer afterwards.
This section outlines how Kelp can be used with an IDE to speed the development process. Using the Kelp tools and wizards together with those of the IDE, you can perform the following basic functions:
- Generating or importing source files
- Setting project properties
- Compiling projects
- Building and deploying archive files
- Debugging projects
Generating or importing source files
Within Forte or JBuilder, you can generate a new Web application, Enhydra application (super-servlet style application), or an Enhydra Service, using the Kelp Application Wizard. The generated framework of files and directories provide a useful starting point for developing applications and services for Lutris EAS.
If you have an Enhydra application that uses the GNU make build system, you can import the application into the IDE using the Enhydra Import Wizard. The Import Wizard sets XMLC properties from the settings in the makefiles. This saves you time and trouble by automating tasks such as setting up the mapping tables to customize generated class names.
Setting project properties
The Kelp project properties consist primarily of XMLC and deployment options. XMLC options can be used to set the name for a generated class file, save the generated Java source-code files, and more. The XMLC options can be specified for a file, a folder, or the project. Project settings will be overridden by folder settings, and folder settings will be overridden by file settings. For additional information about XMLC, refer to Chapter 5, "Enhydra XMLC," of the Developer's Guide.
Deployment properties specify what files to include in the deployable archive file and how to deploy the archive file.
Compiling projects
Once you have generated or added the source files to your project, you can compile the project to generate the necessary classes. If you are using XMLC in your project, you must run the Kelp XMLC tool before compiling the rest of your source files.
Note: Projects compiled or built from within the IDE do not use Ant. If you want to take advantage of some of the advanced Ant capabilities, such as the DODS tasks for automatically generating entity beans, you may want to forgo building your project within the IDE. For additional information about building projects with Ant, refer to Chapter 7, "Using Ant," of Getting Started with Lutris EAS.
Building and deploying archive files
After you have compiled your project you can use the Kelp Deployer to create and deploy an archive file. The Kelp Deployer only deploys to mapped drives.
Debugging projects
If you are having trouble running your application, you can use the debugging capabilities of the IDE to isolate the problem. Forte for Java supports remote debugging. JBuilder supports debugging for applications running within the IDE. Although the debugging capabilities of the supported IDEs differ, both methods are useful. For additional information, refer to "Debugging Kelp projects."
Kelp provides wizards and tools that help you develop Lutris EAS applications from within your IDE:
Starting Kelp
When you install Kelp, the installer program creates start scripts for launching Forte with the added Kelp module. For JBuilder, the installer modifies the configuration script,
Jbuilder.config
. JBuilder configuration changes will take effect when JBuilder is started.To start Forte with Kelp:
- In Windows, choose Kelp from the Lutris EAS menu in the Programs menu (Start|Programs|Lutris EAS|Kelp) to start Forte with the Kelp module.
Note: The Kelp module for Forte may not be compatible with other Forte modules. For example, the Kelp module will not work properly if the 2ME module for Forte is installed. The Java compiler used by J2ME module is not compatible with Kelp.
- Alternatively, you can start Forte with the Kelp module using the start script or batch file,
runKelpForte
orrunKelpForte.bat
, in the<
kelp_root
>/bin
directory, where<
kelp_root
>
is the directory in which Kelp is installed.The Tools menu in your IDE should now have entries for XML Compiler and Kelp Deployer.
Note: The Kelp tools and wizards cannot be used in Forte until you have set up a project with a mounted project directory. See "Setting up a project for use with the Kelp Application Wizard" for instructions.
If the Kelp tools do not show up in Forte's Tools menu at all, you may need to dynamically uninstall and reinstall the Kelp module. To do this, select Global Options from the Tools menu. In the Global Options Window, select the Kelp Tools node in the Modules node. In the Kelp Tools property sheet, change the value for Enabled from True to False, and then back to True.
To start JBuilder with Kelp:
- In Windows, choose Kelp from the Lutris EAS menu in the Programs menu (Start|Programs|Lutris EAS|Kelp) to start JBuilder with the Kelp module.
- Alternatively, you can start JBuilder with the Kelp module using the start script or batch file,
runKelpJBuilder
orrunKelpJBuilder.bat
, in the<
kelp_root
>/bin
directory, where<
kelp_root
>
is the directory in which Kelp is installed.The Tools menu in your IDE should now have entries for XML Compiler and Kelp Deployer.
Using the Kelp Application Wizard
The Kelp Application Wizard, shown in Figure 4.1, speeds up project development by generating the framework and source files for new applications and components. The Kelp Application Wizard uses three generators to create Lutris EAS projects: the Web Application generator, the Enhydra Service generator, and the Enhydra Application generator.
The Application Wizard uses the following generators:
- Web application (Servlet 2.2 compatible)
- Enhydra Service (as outlined by the Enhydra Service Architecture)
- Enhydra application (super-servlet style application)
Creating a new project:
To use the Kelp Application Wizard from within the IDE, create a project beforehand. The Forte Project must have a mounted directory into which you will generate your project files.
Important: Running the Kelp Application Wizard while you are using a project that already contains files generated by the Kelp Application Wizard might cause unexpected results. Before you run the Kelp Application Wizard, create a new project for the generated files.
- To generate a project file in Forte, choose Kelp Application Wizard from the File menu to launch the Kelp Application Wizard. Then, choose the component type to generate from the Component Type pull-down menu.
Figure 4.1 Kelp Application Wizard, launched from Forte
![]()
Note: To create a new project in JBuilder, choose New from the File menu to open the Object Gallery as shown in Figure 4.2. Click the Enhydra tab, select the component type to generate, and click OK. The Object Gallery in JBuilder replaces the first page of the Kelp Application Wizard. The rest of the wizard is unchanged.
Figure 4.2 Object Gallery in JBuilder, showing choices for generating Lutris EAS components
![]()
- Navigate through the wizard and select the options and naming conventions for your generated files.
- When you have finished setting the options you want, click Finish to generate your application or service. When generation is complete, view the newly generated
Readme.html
file that has been added to your project.Readme.html
shows the steps you need to build and run the application or service. The steps will vary, depending on which IDE you are using.For more information on the Kelp Application Wizard, see Chapter 2, "Using the Kelp Application Wizard," of the Developer's Guide. Once you create a project, you can use the Kelp XMLC tool and the Kelp Deployer tool to work with it.
In both the Kelp XMLC tool and Enhydra Deployment wizards, you use a tabbed dialog box to select files, set options, and view the build process.
Using the Enhydra Import Wizard
The Enhydra Import wizard lets you quickly import source files from an existing Enhydra 3.x project that uses the GNU Makefile system into a JBuilder project, capturing any XMLC options specified in the Makefile system.
Note: The Enhydra Import Wizard is only supported by JBuilder.
Note: Applications generated by the Kelp Application Wizard from within the IDE do not use the Makefile system or Ant. Lutris EAS applications generated using the Kelp Application Wizard launched from the command line include a
build.xml
and are built with Ant.The following steps explain how to import, build, and run an Enhydra 3.x application using Kelp with JBuilder 4 or 5. The steps are divided into three sections:
Importing an application
To import an application into JBuilder, follow these steps:
Note: The following steps assume that you are importing a project that builds and runs.
- Create a new JBuilder project file.
- In JBuilder, choose New Project from the File menu (File|New Project).
This opens the Project Wizard dialog box.
- In the Project Wizard dialog box, set Project Name to the name of your application.
This name has no impact on the project or application, but we recommend that you use the name of your application for consistency.
- Set the Root Path to the directory above the directory that contains your application.
For example, if your application is in
/enhydra/myapps/MyApplication
, set the Root Path to/enhydra/myapps
. You can click the button to the right of the field to navigate to the directory.- In the Project Directory Name field, enter the name of your application directory (e.g.,
MyApplication
).- Accept the defaults for the rest of the fields.
- Click Finish to generate the new project.
- Choose Wizards|Enhydra Import.
- Set the project directory to your project directory (e.g.,
/enhydra/myapps/MyApplication
).- Click Next to navigate through the wizard, accepting all default settings.
- Click Finish to import the project.
Building an application
To build the application, follow these steps:
- Open the XML Compiler.
- Click Compile to generate the DOM Java source files using XMLC.
- When XMLC is finished compiling, click Close.
- Choose Project|Make to compile the Java source files.
- Choose Tools |Kelp Deployer.
- Click Deploy to copy static content files, process configuration templates, and create a deployable archive.
Running an application
To run the application, follow these steps:
- Choose Project|Project Properties.
- Add an required libraries (e.g., database drivers) to the required library list:
- Select the Paths tab.
- Select the Required Libraries subtab.
- Click Add.
- Click New.
- Name the library.
- Click Add.
- Navigate to the location the needed JAR file, select it, and click OK.
- Click OK until the Project Properties dialog box is closed.
- Choose Run|Run Project.
- Open a browser to
http://localhost:9000
, where 9000 is the specified port, to view the application.Using the Kelp XMLC tool
The XML Compiler dialog calls XMLC, which compiles HTML, WML, cHTML, and XHTML files into DOM classes. To open the dialog, choose XML Compiler from the Tools menu. The tool is available only when a project is open.
The dialog box has three primary tabs: Selections, Options, and Output. The Selections tab, shown in Figure 4.3, displays all files in the currently selected project that are recognized as compilable by XMLC. You can use the single arrow buttons (
<
and>
) to add or remove files from the list selected to be compiled. Use the double arrow buttons (<<
and>>
) to add or remove all files from the selection list. Select the Show Full File Path check box to display the full path of the files.Figure 4.3 Selections tab of the XML Compiler dialog
![]()
The Options tab displays additional tabs for compile, XMLC types, and trace options.
- The Compile options let you customize the generated DOM classes.
- The XMLC Types tab allows you to add new file extensions to associate types of files with XMLC. Files with the specified extensions display on the Selections tab and can be selected if you want them to be processed by XMLC.
- The Trace options let you display detailed information during the compile process without affecting the generated classes.
Note: In JBuilder, the Options tab also has an Invoke XMLC during Project Make/Rebuild check box. Select this check box to call XMLC without opening the XML Compiler dialog. This calls XMLC when you build or make a project node that contains a selected XMLC document type file.
Figure 4.4 Options tab of the Kelp XMLC tool
![]()
The Output tab shows the results of running XMLC based on the files you selected on the Selections tab. For information on the Output tab, see "Setting output options."
Using mapping tables for generated class names
One common option is to use a mapping table to customize generated class names. By default the XML Compiler dialog uses the current directory name to determine the package name in the generated source. Unless your HTML files are stored in the same directory as your presentation package Java source files, you need to use the mappings option to map the resource document directory to the presentation package name.
Note: The Lutris guidelines recommend that you keep your XMLC documents in a
resources
directory and map them to the presentation package when you are generating the DOM classes. Both the Kelp sample project and the DiscRack example store HTML files in aresources
directory.
- Click Edit in the Mappings section of the Make tab. This opens the Project Map editor, which lets you associate source directories with package names.
- Click Add to create a new mapping.
You can enter a source directory or use the Set button to navigate to one.
The dialog box in Figure 4.5 shows how to set up the compiler to use the
kelp.webapp.presentation
package name when you are compiling HTML pages stored inD:/jbuilder4/kelp4/samples/webapp/src/kelp/webapp/resources
.Figure 4.5 Mapping a source directory to a package
![]()
Setting output options
The Output tab (Figure 4.6) is automatically selected when you click Compile in the XML Compiler dialog. This tab contains a scrollable text area that displays the results of the compile. If you have any errors in your HTML files, the problems appear on this tab. You can optionally save the output to a text file by selecting Output To Log File and entering a file name.
Figure 4.6 Output tab of the XML Compiler dialog
![]()
The Output page displays the files that are created during the compilation process. At the start of the compilation process, the dialog erases any files it created during a previous compile. If an HTML file contains a new error, the associated Java and class files are erased and not regenerated.
Using the Kelp Deployer
The Kelp Deployer lets you quickly configure projects for your current environment and directory structure. The Kelp Deployer helps you perform the following four tasks:
- Generate configuration files and deployment descriptors from input templates.
- Copy static content to your document root.
- Create a deployable archive, based on the type of application or component.
- Set up your project so you can launch Lutris EAS with your application.
General tab
This tab sets and displays basic information about deployment. The messaging options control how status messages are handled during deployment.
- Deploy Root: Used for setting the archive document root directory. Click the Ellipses (...) button to navigate to a folder.
- Deploy Type: Choose the Lutris EAS component to deploy from this pull-down menu.
- Web Application: If your project uses the Java servlet API, choose Web Application. Servlet archives are Web Application Archive (WAR) files that contain the output classes, static content files, and a deployment descriptor.
- Enhydra Service: If you are deploying a service, choose Enhydra Service. Enhydra Services archives are Java archive (JAR) files that contain the output classes and a deployment descriptor.
- Enhydra Application: If you are using the Enhydra super-servlet API, choose Enhydra Application. Enhydra super-servlet archives contain the classes in your output directory.
- Deploy Messages
Display During Project Make/Rebuild: Used in JBuilder when the Kelp Deployer is set to invoke during project building.
Write to File: Allows you to save all messages to a log file.
- Deploy During Project Make/Rebuild check box: Select Deploy During Build to deploy your application on each project rebuild. The Show Messages box is enabled if Check Deploy During Build is selected. If you select Show Messages, deployment messages will be shown in the Output tab.
- Overwrite Without Warning: Normally, you want this checked. Otherwise, a warning dialog box is opened for every file that is redeployed.
Input tab
Template Path points to the location of your project's
.in
files, which are template files. These files are processed and copied to your Deploy Root folder using relative paths.
- Selections tab: Lets you select which of the available template files in your project will be processed. The left pane shows available templates, and the right pane shows the selected templates. Use the arrow buttons to move files from one pane to the other. Double arrow buttons (
<<
and>>
) move the entire contents of one pane to the other. Single arrow buttons (<
and>
) move the selected file or files from one pane to the other.
- Replacements tab: Lets you adjust the template settings for your project. Templates have the extension
.in
. Templates are text files with placeholders that are replaced with system-specific information by the Kelp Deployer. One of the default placeholders,@CLASSES@
, is replaced with the current class output directory specified by your project.
You can customize the search and replace mechanism by editing the data in the Replace Text table on the Options tab of the dialog. The default option lets you quickly restore the default project settings. The Replace With values can refer to relative paths. If you enter a value starting with a period, the Kelp Deployer substitutes the directory containing the project file for the period. For example, if you open the Kelp Web Application project from:
/home/user/jbprojects/samples/webapp/KelpWebApp.jprand have a Replace Text table containing
The resulting configuration files (
.conf
) will contain/home/user/jbprojects/samples/webapp/classes
in place of the@CLASSES@
placeholders that are in each of the templates (.conf.in
).For applications deployed on Windows, some Text to Find values of the form
@*_PATH@
are handled differently than typical Text to Find values. They are expanded according to the following find values to deal with the different forms of Windows paths:
@SHELL_*_PATH@
expands to UNIX-style paths with the system drive as the root of the file system and the//<
drive_letter
>/<
dir
>
format for other drives. For example,//d/myDir
.@JAVA_*_PATH@
expands to Java-style Windows paths with the<
drive_letter
>:/<
dir
>
format. For example,d:/myDir
.@OS_*_PATH@
expands to Windows-style paths with the<
drive_letter
>:\<
dir
>
format. For example,d:\myDir
.You can change the order for replacements using the Move Up and Move Down buttons. Items at the top are replaced first. The Reset button sets the Replace With text back to the default values.
- Show Full File Path: Displays the full path for files.
- Input Templates (.in) Only: If not checked, you can have the Kelp Deployer copy (without searching and replacing strings) all non-template (
.in
) files from the input root directory to the deploy root directory.- Enable Input Deployment: Enables or disables input deployment. If you are using auto-deploy, you can normally disable input deployment.
Content tab
The Kelp Deployer will copy content types from the content source directory to the archive document root. Use the archive document root to select content when building Web application archives.
- Paths: If you select Enable Content Deployment, you can choose or specify the directory containing the static content files you want to deploy with your Web application.
- Content Source: The directory that contains the static content files for your project. These static files will be copied to your document root using relative paths.
- Archive Document Root: This field cannot be edited. It lists the directory where the archive file will be created.
- Types: The Content Types subtab shows the extensions of static resource files that will be copied from the Content Source directory to your document root directory. Click Add to enter a new extension. Choose an extension and click Remove to keep files with that extension from being copied. Click Reset to go to the default values of recognized extensions.
Archive tab
The Kelp Deployer can create and recreate archive files that you can auto-deploy to a running Lutris EAS server. The table lists the archives that have been or will be generated during deployment. If the Built check box is selected for an item, then a deployable archive already exists.
Clicking Edit opens the Kelp Archive Wizard. The wizard lets you create an archive. For more information about the Kelp Archive Wizard, refer to the Chapter 3, "Using the Kelp Archive Wizard," of the Developer's Guide.
Run tab
The deployer can deploy archives to a Lutris EAS server running locally or set up your project so you can launch it from the IDE.
- Auto-Deploy to Locally Running Server: Specifies that the generated archive file be deployed to the local instance of Lutris EAS. If the server is running, the application or service is deployed immediately when you deploy. Otherwise, the application or service will be deployed when the server is started.
- Configure Project for Starting Server from IDE: Specifies that a
StartServer
class be generated for starting the project from within the IDE.Deployment example: Deploying a Web application
After you have generated and built a Web application, you can deploy the Web application archive (WAR) in a few different ways using the Kelp Deployer.
To run the application manually on a restricted instance of the Lutris EAS server:
Kelp can generate scripts for running your application locally in an isolated instance of the Lutris EAS server. This instance of the Lutris EAS server loads the minimum number of services required to run your application. This configuration of the Lutris EAS server does not support the use of the LMC or the Web console.
- Select the Run tab in the Kelp Deployer dialog.
- Select Configure Project For Starting Server From IDE.
- Click the Deploy button.
- In a shell window, change directories to
<
project_root
>/output
, where<
project_root
>
is your project directory.- Execute the start script,
run
orrun.bat
, to launch a local instance of the Lutris EAS server.This instance of the Lutris EAS server loads only the services required to run your application. The application is started automatically.
Note: You may need to set the script to be executable.
- When Lutris EAS server is finished booting, access the application with a browser at the following URL:
You should see the
Welcome.html
page with a redirect and a dynamic time stamp.To hot deploy your application:
Hot deployment consists of deploying an application or component to a running instance of Lutris EAS. The Kelp Deployer can only deploy to a Lutris EAS server running locally (that is, running on a mapped drive).
- Execute the Lutris EAS server start script,
multiserver
ormultiserver.bat
in<
eas_root
>/bin
(where<
eas_root
>
is the directory in which Lutris EAS is installed) to start the server.Note: It is important to launch the Lutris EAS server from the
/bin
directory.- Select the Run tab in the Kelp Deployer dialog.
- Select Auto-deploy to Locally Running Server.
- Click the Deploy button.
The archive file is copied to
<
eas_root
>/deploy
directory (where<
eas_root
>
is the directory in which Lutris EAS is installed). The Lutris EAS server will deploy the file automatically. When the file is deployed by Lutris EAS, the WAR file is removed from the/deploy
directory.- Start the Lutris Management Console.
- To start your application, log in to the Lutris EAS server to which you deployed your application.
The default username and password are
admin
andenhydra
, respectively.- In the LMC Browser, select the Web application, and click Start in the Operations section displayed in the Workspace.
- Access the application with a browser at the following URL:
where appname is the name of your WAR. The name of the WAR is used as the URL prefix by default. You should see the
Welcome.html
page with a redirect and a dynamic time stamp.To run your application from within the IDE:
- Select the Run tab in the Kelp Deployer dialog.
- Select Configure Project For Starting Server From IDE.
- Click the Deploy button.
- Find the generated
StartServer.java
file in the project source directory.- Right-click the node and choose Compile from the context menu.
- Right-click the
StartServer
node again and chose Execute from the context menu.This starts the Lutris EAS server from within the IDE.
- When Lutris EAS server is finished booting, access the application with a browser at the following URL:
You should see the
Welcome.html
page with a redirect and a dynamic time stamp.
After creating a Forte project to manage your source, you can edit Kelp project properties by choosing Settings from the Project menu. The Project Settings window contains two Kelp-specific nodes: XML Compiler and Kelp Deployment. By selecting either node, one can set "simple" properties via the property sheet. For more robust settings, however, one should use the customizer, accessible via the node's Customize context menu option.
Node properties can be set on recognized markup language files (for example, HTML, WML) and template files by right-clicking on the node and selecting the Customize option. The selected property can be set more quickly by using the node's property sheet, which is viewed by selecting the Properties context menu option.
Classpath
The classpath is set by mounting directories and JARs to the project's Filesystems collection. By default, some of the Lutris EAS JARs are mounted when Forte starts, and do not appear in the Filesystems tab. These JARs include:
<
eas_root
>/lib/Kernel.jar
<
eas_root
>/lib/Wireless.jar
<
eas_root
>/lib/LutrisWireless.jar
<
eas_root
>/lib/Boot.jar
<
eas_root
>/lib/build.jar
<
eas_root
>/lib/xmlc.jar
<
eas_root
>/tool/lib/toolbox.jar
Where
<
eas_root
>
is the directory in which Lutris EAS is installed. When using the Kelp Application Wizard, additional JARs may be added to the mounted Filesystems if they are required to build the default configuration.Project directory
The project directory is where Kelp will look for the default input, output and source directories, or their equivalents. As Forte does not create a tangible project directory the way JBuilder does, the user will have to provide this directory. By default, the Project directory is assumed to be the first directory added to the project (not to be confused with the first mounted directory). This default can be overridden via the XMLC "Project Directory" property.
Source directory
Kelp uses the source directory as the parent for all generated packages. The source directory defaults to
<
project_dir
>/src
, but this can be overridden by adjusting the "Source Directory" XMLC property.Output directory
Kelp for Forte does not have an output directory, per se. The output directory is the same as the source directory, and this is where the class files should be generated on compilation.
Deploy root
The deployment root directory can be set through the Kelp deployer property sheet.
Run options
When deploying your application, if you have chosen to generate a
StartServer.java
file, you can run your application from the IDE. In this case, a preconfigured external executor should be attached to theStartServer
file, so you can right-click the node and select Execute from the context menu.Setting up a project for use with the Kelp Application Wizard
If the Kelp Application Wizard is used to jump-start your development effort, we recommend the following project setup:
- Create the project directory.
- In Forte, choose New Project from the Project menu (Project|New Project).
- In the Create New Project dialog, enter a name for your project.
Kelp does not use this project name internally, so there are no naming restrictions.
- When asked if you would like to start with a new Filesystem configuration, choose the New option.
- When prompted to mount a directory, select your project directory.
- Once the project is created, select the Project tab in the Explorer window.
- Right-click on the project root and choose Add Existing from the context menu.
- Select your project directory and click the "OK" button.
You are now ready to generate a new application. See "Using the Kelp Application Wizard" for more details.
JBuilder provides many properties that let you customize your projects. After opening a project that you want to use with Lutris EAS, choose Project|Properties to configure path, compiler, and run settings. You do not need to enter anything in the Servlets tab to work with applications for Lutris EAS. Most of the settings you will use are found on the Paths tab.
Property pages are dialog boxes in which you set build options for the entire project or for a selected node in JBuilder. A node is an object in the project tree of a JBuilder project. For the purposes of this section, a node refers to a file in a project. Project property pages appear as tabs in the Project Properties dialog box. Node property pages let you customize options for a specific file in your project.
The Kelp project property pages add to JBuilder's existing Code Style, Paths, Run, and Compiler property pages. The Paths property page is where you set the library files your project requires.
- To open the Project Properties dialog box, choose Project|Project Properties.
- To open a Node property page, right-click a file in your project and choose Properties from the right-click menu.
JBuilder opens a property page specific to the file you have selected. If you right-clicked a Java source file, the property page will have RMI (Remote Method Invocation) and JNI (Java Native Interface) settings. To open the Input Template node property page, right-click any file with a
.in
extension in the template directory,/input
. When you right-click an HTML file and select Properties, the XMLC node property page appears. In JDeveloper, right-click the HTML file and select XMLC Properties.PATH and CLASSPATH settings
The PATH and CLASSPATH settings are critical for being able to compile and run your applications.
Paths page
Configuring your project to use the correct paths for file output, project files, and libraries will simplify the development of applications for Lutris EAS. This section describes the options on the Project Properties Paths page that are relevant to using Kelp.
Output path
The output directory specifies where you want class files to be created. It is also where the Lutris EAS server looks for images that have relative references to the presentation objects. For example, the Kelp Application Wizard creates images under:
<source_directory>/<package_directory>/presentation/mediaWhen you build the project inside JBuilder, the image is copied to the output directory along with the compiled class files. For the image to be displayed properly, the output directory must be set to a
classes
subdirectory under the source directory.The Kelp Deployer also uses this setting when it creates deployable archives.
Source subtab
The source path is where the compiler looks for Java files and packages to compile. When you compile package names, the source files will be in subdirectories under the source directory. For example, if your highest-level package is
com
, thecom
directory will be located directly under a source path.You can set the source path to the same location as the project file. When you create a project using the Project wizard in JBuilder Foundation, it creates a directory for your project under
jbprojects
in your home directory. You can use this directory as your source.JBuilder lets you select multiple source paths. This can be useful when you are working on several modules from source code.
Note: If you are using automatic source packages in JBuilder 4, make sure that your output path is not a subdirectory of any of your source paths.
Note: Remove any source paths that your project does not require.
Required libraries subtab
The application CLASSPATH must contain the following JARs in order to build and run Lutris EAS applications:
<
eas_root
>/lib/build.jar
<
eas_root
>/lib/boot.jar
<
eas_root
>/lib/eaf.jar
<
eas_root
>/lib/Wireless.jar
<
eas_root
>/lib/LutrisWireless.jar
<
eas_root
>/lib/servlet.jar
<
eas_root
>/lib/WebService.jar
<
eas_root
>/lib/xmlc.jar
where
<
eas_root
>
is the directory in which Lutris EAS is installed. You can add JARs to an applicationCLASSPATH
by using JBuilder libraries. If you installed Kelp using the Windows installer, you already have an Enhydra library defined for you. If you are using JDBC in your application, you will need to add the JDBC driver as a library.If you need to define an Enhydra library in JBuilder Foundation, click Add and then click New. Name your library and click Add to navigate to the JAR file you want to add.
Note: You might need to modify the Enhydra library if you have upgraded to a newer version of Lutris EAS. Make sure the JARs specified for the library match the JARs referenced in the IDE CLASSPATH. Use the About button in the XML Compiler dialog to determine the version of Lutris EAS that is in the IDE CLASSPATH.
Build properties
This section describes the options on the Project Properties Build page that are relevant to using Kelp.
Generate source to output path option
On the Build page, you can select Generate Source To Output Path to keep the generated XMLC Java files separate from your
HttpPresentation
implementations. If you select this option, the Java source files for the DOM classes will be created in aGenerated Source
directory under your output classes directory.Run options
This section describes the options on the Project Properties Run page that are relevant to using Kelp.
Main class option
JBuilder Foundation lets you specify which class to run when you run the project. This class does not need to be part of your project's source files.
If you have an Enhydra library selected under the Required Libraries option, you can use the main class to launch the Lutris EAS server. Use the Set button to select the Lutris EAS server startup class,
com.lutris.multiServer.Multiserver
.Application parameters option
If you have set the main class to launch the Lutris EAS server, you can use the application parameters to pass in a configuration file. For example, if you create a Web application using the Kelp Application Wizard, the application parameter is set to:
<source_directory>/output/conf/servlet/servlet.confEnhydra Deployment property page
Choose Project|Project Properties and select the Enhydra Deployment tab to view the Enhydra Deployment properties.
The Enhydra Deployment property page contains the same settings as the Options tab of the Kelp Deployer. For more information, see "Using the Kelp Deployer."
XMLC properties can be set for the project, a folder, or individual files. XMLC properties set for a file always override properties set for a folder, and folder properties always override properties set for the project.
XMLC project properties
You can view the XMLC project properties page by opening the Project|Project Properties dialog box and selecting the Enhydra XMLC tab (Figure 4.7). This page shows the same make and output options that you can set on the Options tab of the XML Compiler dialog.
Figure 4.7 Project Properties page
![]()
The Compile tab includes three sections:
- Generated Java Source: Tells you which XMLC options need to be set for the current IDE.
- Mappings: Determines how class names are generated.
- XMLC Options: Lets you specify XMLC command-line options or select an XMLC Options file to set XMLC options. For more information on XMLC command-line options, see Chapter 5, "Enhydra XMLC," of the Developer's Guide.
Click Edit to open the XMLC Parameter Editor. The XMLC Parameter Editor lets you organize complex XMLC command-line options.
In the Mappings section, you can define a mapping table and set the nodes that you want to use with the table. The mapping table lets you specify package names to use when generating DOM classes for a given directory. For example, the sample Kelp Web application project uses a mapping table to map all the HTML files in a resources directory into the
kelp.webapp.presentation
package.To view or edit the package name mapping:
This opens the mapping table, where you can add a new entry that maps a directory to the correct presentation package. Here is a sample mapping for the Kelp sample project:
/user/local/jbuilder/kelp2
/samples/webapp/src/kelp/webapp/resourceskelp.webapp.presentationSelect the Output tab on the XMLC page in Project|Properties. These settings cause the XMLC to stream out additional information when compiling the HTML files. The Output settings do not affect the generated DOM classes.
Note: For faster compiles, deselect all the Output options.
XMLC node property page
You can open the XMLC node property page by right-clicking an HTML, cHTML, WML, or XHTML file in the Project pane and selecting Properties. This opens the Properties page for the selected file. As Figure 4.8 shows, this page has four options:
- Copy to Output as a Static Resource: Select if the file will be served as a static file. The file will be copied to the output directory.
- Generate DOM Class: Select if you want to select this file for compilation with XMLC.
- Generated Class Names: Lets you configure the names of generated classes. Click Map Table to open the Map editor.
- XMLC Options: Lets you enter XMLC command-line options for the selected file, or for your entire project. This option is available only when Generate DOM Class is selected.
Figure 4.8 XMLC Node Properties page
![]()
How Kelp sets class names for XMLC
You can use the Generated Class Name section to specify how you want to generate the class name. There are three choices: default, custom, and mapped. The file name, directory location, and project source path determine the default name.
For example, if you create a new application in
/home/bob/jbprojects/untitled1
, the source path for theWelcome.html
file is/home/bob/jbprojects/untitled1
, the directory location is/home/bob/jbprojects/untitled1/untitled1/presentation
and the file name isWelcome.html
. The package name isuntitled1.presentation.WelcomeHTML
.The source path is removed from the directory location to create the new package name. The new class name is formed by removing the
.html
extension and adding "HTML". Select the Custom option if you want to enter your own class name. When using custom class naming, make sure the name you enter conforms to a valid Java identifier.Note: If the selected HTML file is not located in a subdirectory of one of the Project source path settings, Kelp might not be able to generate a valid default class name.
To map your HTML files to user-defined class names, select Mapped and click Map Table to open the Edit Project Map dialog box. XMLC uses this mapping table to set custom package names based on the directory of the HTML file. This mapping table is normally used to map a
resources
directory to a presentation package. There is only one mapping table per project. For more information, see "XMLC project properties" and "Using the Kelp XMLC tool."Setting XMLC options for selected files
To set additional XMLC options for the selected file, use the XMLC Options section in the XMLC node property page (see Figure 4.8).
Command-line parameters let you add command-line options to XMLC from within your IDE. Click Edit to open the XMLC Parameter Editor. The Parameter Editor allows you to organize complex command-line parameters. If you have an options file for XMLC, click Set and select the options file. To clear a previously selected options file, click Clear. For more information on using XMLC, see Chapter 5, "Enhydra XMLC," of the Developer's Guide.
Note: The following XMLC command-line options are not supported by the Kelp XMLC tool:
Input Template node property page
The Input Template node property page contains the same settings that appear on the Template tab of the Kelp Deployer project properties page. Right-click the
.in
file and choose Properties to open the Input Template node property page for a.in
file in your project.In addition to the project properties, there is a Generate
.conf
check box you can select to generate configuration files for the current template.
Kelp includes two sample projects that demonstrate how to use XMLC and Lutris EAS to create Web and wireless applications within an IDE. If you are new to both Lutris EAS and Kelp, you can start learning Lutris EAS by running the Kelp sample Web application. The Kelp sample demonstrates only a small part of Lutris EAS's capabilities.
Once you feel comfortable with the Web application sample, examine the LutrisBank example that comes with Lutris EAS, located in
<
eas_root
>/examples/LutrisBank
, where<
eas_root
>
is the directory in which Lutris EAS is installed. The LutrisBank example provides a more complete application that incorporates JDBC access. The LutrisBank example is set up to use InstantDB, but can be modified to work with most JDBC-compliant data sources, including Oracle, Microsoft SQL Server, and PostgreSQL.If you are already familiar with Lutris EAS, you can use LutrisBank to see how to set up a project for your own applications. For more information on LutrisBank, see Chapter 6, "The LutrisBank tutorial application," of Getting Started with Lutris EAS.
Sample Web application
The sample Web application consists of four presentation objects that show some of the common uses of XMLC. The sample is simplified in that it only contains a presentation layer. Production Web applications normally contain at least three packages, including presentation, business, and data. For a detailed explanation on how you can separate applications into these three functional areas, see Getting Started with Lutris EAS.
Note: If you have moved a sample project after running the Kelp Deployer, run the Kelp Deployer again before using the sample.
Each servlet dynamically generates HTML files using XMLC. The HTML source files are located in a resources directory. Each HTML file is compiled into a class file using XMLC. There is a corresponding Java file that implements
HttpServlet
for each HTML file. These files work with the generated HTML classes to create and process input from the Web pages. The Java files are located in thekelp.webapp.presentation
package. The four servlets demonstrate the following:
- Greetings Servlet: This is similar to a traditional Hello World example. This servlet contains one HTML element. Using XMLC, this element is set to greet the user with a phrase contained in the Java source.
- Table Servlet: One of the most common tasks in dynamic HTML generation is populating an HTML table. This servlet shows you how to define a table as a template in HTML and then populate it through Java when a user requests the page. In a real-world application, the data would most likely come from a JDBC data source. For the sake of simplicity, this example populates the table with an array of values that are hard-coded into a Java file.
- New Node Servlet: XMLC allows you to insert HTML blocks from external sources into an existing page. This example shows a page containing a span of HTML that is read in from a text file. You can modify the text file to alter the page without recompiling the HTML or Java files.
- Form Servlet: You can use XMLC with HTML input fields to create data entry forms. This servlet shows you how to update a file on the server with input values retrieved from a Web browser. For simplicity, this example uses a property file to store displayed values. Normally, values are stored in a JDBC data source that is accessed through the business and data layers of an application.
Note: The Form Servlet,
FormServlet.java
, uses a properties file,form.properties
, to store data instead of using a database. The application looks for this file locally. The form data cannot be changed if the application is deployed to a remote server.For instructions on buiding and deploying the sample Web application, refer to "Debugging with Forte" and "Debugging with JBuilder."
Sample wireless application
The sample wireless application illustrates how to use XMLC to generate wireless markup language (WML) files dynaically. The following instructions describe how to build and deploy the sample application in Forte for Java.
Note: A JBuilder project file,
KelpWireless.jpr
, makes it easy to build and deploy the wireless sample application in JBuilder. To build and run the application in JBuilder, open the project file and follow the instructions below, starting at step 3.
- Create a new project in Forte (Project|New Project) and mount the directory containing the wireless sample applicatin,
<
kelp_root
>/samples/wireless
, where<
kelp_root
>
is the directory in which Kelp is installed.This mounted directory will be refered to as the project root,
<
project_root
>
, throughout these instructions.- Add the project directory to your project to include all of the sample application files into your project.
- In the Explorer view, click the Project tab.
- Right-click the root Project node, and choose Add Existing from the context menu.
- In the Select Objects dialog box, navigate to the filesystem, package, or file you want to add to the project and click OK.
- Use the Kelp XMLC tool to generate DOM classes for your HTML files in the
/resources
directory.
- Open the Kelp XMLC tool (Tools|XML Compiler).
- In the Selections tab, ensure that the two WML files in the
/resources
directory,Select.wml
andWelcome.wml
, are selected for compilation.- In the Options tab, click Map Table in the Compile section to open the Edit Project Map dialog box.
- In Edit Project Map dialog box, click Add to open the Add a New Directory to Package Mapping dialog box, and set the following mapping:
Source directory:
<
project_root
>/src/kelp/wireless/resources
Package name:
kelp.wireless.presentation
where
<
project_root
>
is your project directory. Click OK to add the mapping and then click Close to close the Edit Project Map dialog box.- Click Compile to generate your DOM classes.
- Click Close to close the Kelp XMLC tool.
- Build the project (Project|Build Project).
- Use the Kelp Deployer to create an archive and deploy your project.
- Open the Kelp Deployer (Tools|Kelp Deployer).
- In the General tab, ensure that the Deploy Root is set to <project_root>/output (where
<
project_root
>
is your project directory), and that the Deploy Type is set to Web Application.- In the Input tab, check Enable Input Deployment, check Input Templates (.in) Only, verify that the Input Root is set to
<
project_root
>/input (
where<
project_root
>
is your project directory)
, and click the Select All button (>>
) to select all four Input Templates.- In the Content tab, uncheck Enable Content Deployment.
There are no static resources for this application.
- In the Archive tab, click Remove to remove
wireless.jar
if present, and click Add to open the Archive Wizard.- In the Archive Wizard
Select Web Application from the pull-down list and click Next.
Set Archive to
<
kelp_root
>/samples/output/lib/wireless.war
, selectweb.xml
in<
kelp_root
>/samples/wireless/src/WEB-INF
for the web deployment descriptor, and click Next.Select the four class files:
SelectService.class
,SelectWML.class
,WelcomeServlet.class
, andWelcomeWML.class
, and click Next.Click Finish to create the archive and return the the Kelp Deployer.
- In the Run tab, choose Auto-deploy to Locally Running Server, verify that the Deploy Directory is set to
<
eas_root
>/deploy
(where<
eas_root
>
is the directory in which Lutris EAS is installed), verify that the Deploy File is set to<
project_root
>/output/lib/wireless.war
, and click Deploy.This creates a WAR file in
<
project_root
>/output/lib
., and deploys the the WAR to a local instance of the Lutris EAS server. If the server is running, the application is deployed immediately. Otherwise, the application will be deployed when the server is started. The application starts automatically.- Using a wireless device or emulator, browse to http://<host_name>:8002/wireless, where <host_name> is the name of the server on which the application is deployed.
One of the advantages of using an IDE for developing applications and components for Lutris EAS, is that the IDE provides tools for debugging. The Kelp Sample Web application, located in the
<
kelp_root
>/samples/webapp
directory (where<
kelp_root
>
is the directory in which Kelp is installed), provides a simple example for demonstrating how applications deployed on a Lutris EAS server can be debugged with Forte or JBuilder.Debugging with Forte
Forte supports remote debugging using the Java Platform Debugger Architecture (JPDA). The JPDA enables you to set breakpoints on classes, threads, and variables; to set conditional breakpoints; and to examine the value of an expression. The JPDA is the default debugger if you are running the Java 2 Platform, Standard Edition (J2SE), SDK 1.3.
The Debugging workspace automatically loads when you start a debugging session. By default, this workspace includes three windows:
- The Debugger window, with separate tabs for managing breakpoints, variables, watches, and threads.
- The Output window, for displaying messages from the debugger.
- The Source Editor, for showing the line in the source code where the program is stopped.
To build and deploy the Kelp Sample Web application:
- Create a project directory named "webapp".
- Copy the
/source
and/input
directories for the sample Web application from<
kelp_root
>/samples/webapp
(where<
kelp_root
>
is the directory in which Kelp is installed) into your project directory.- Create a new project in Forte (Project|New Project) and mount your project directory containing the
/input
and/source
directories.- Add the project directory to your project to include all of the sample application files into your project.
- In the Explorer view, click the Project tab.
- Right-click the root Project node, and choose Add Existing from the context menu.
- In the Select Objects dialog box, navigate to the filesystem, package, or file you want to add to the project and click OK.
- Use the Kelp XMLC tool to generate DOM classes for your HTML files in the
/resources
directory.
- Open the Kelp XMLC tool (Tools|XML Compiler).
- In the Selections tab, ensure that the four HTML files in the
/resources
directory are selected for compilation.- In the Options tab, click Map Table in the Compile section to open the Edit Project Map dialog box.
- In Edit Project Map dialog box, click Add to open the Add a New Directory to Package Mapping dialog box, and set the following mapping:
Source directory:
<
project_root
>/src/kelp/webapp/resources
Package name:
kelp.webapp.presentation
where
<
project_root
>
is your project directory. Click OK to add the mapping and then click Close to close the Edit Project Map dialog box.- Click Compile to generate your DOM classes.
- Click Close to close the Kelp XMLC tool.
- Build the project (Project|Build Project).
- Use the Kelp Deployer to create an archive for your project.
- Open the Kelp Deployer (Tools|Kelp Deployer).
- In the Input tab, select Enable Input Deployment, deselect Input Templates (.in) Only, verify that the Input Root is set to
<
project_root
>/input (
where<
project_root
>
is your project directory)
, and click the Select All button (>>
) to select all files.- In the Content tab, select Enable Content Deployment, set Content Source to
<
project_root
>/src/kelp/resources
, and set Archive Document Root to<
project_root
>/output/content
.- In the Archive tab, verify that the path for the archive file is
<
project_root
>/output/lib
.- In the Run tab, select Configure Project for Starting Server from IDE and click deploy.
- Follow the instructions to deploy and debug the sample application in one of the following sections:
To start and debug the application from within Forte:
When you deployed your application with Configure Project for Starting Server from IDE selected, a
StartServer
class is created. This class is used to start the application, but it can also be used to start a debugging session.Note: By default, when you start a debugging session from within the IDE, the server is configured for debugging using socket transport, and the Classic Switch is set to True for the default debugger.
- To start a debugging session, select the
StartServer
class, and choose Start Debugging from the Debug menu.The Output Window will open and display the port assigned for debugging in the Debugger section. For example, the Output Window will display a line like the following:
Listening for transport dt_socket at address: 1029where
1029
is the port reserved for debugging. The server will remain paused until you attach to the VM at the specified port.- Attach to the VM.
- Choose Debug|Attach to VM from the menus.
- In the Attach to VM dialog, set the following options to start debugging:
Enter the name of the host upon which the Lutris EAS server was started (for example, localhost)
- Click OK to attach to the VM.
The EAS server will resume starting, and an Application Server window consisting only of a Shutdown Server button is opened. Server startup messages are displayed in the StartServer tab (src.StartServer - I/O). When the core elements of the server have been loaded, a notice is printed to the Output Window, indicating that the "Bootstrap process completed." When the bootstrap process is completed, you can access your application from a browser.
- Open
TableServlet.java
in thekelp.webapp.presentation
package.- Locate the
for
loop of thecreatePage()
method and click the left edge of the editor to put a breakpoint on the line that readstable.appendChild(newRow);.
After you set the breakpoint, the line appears in red as shown in Figure 4.9.
- Access the application in a browser at http:/localhost:8002 to exercise the code you are debugging.
- Click the Table Page link to trigger the breakpoint.
- When the breakpoint is reached, a message similar to the following is displayed in the Output Window in the Debugger section:
Breakpoint reached at line 85 in class kelp.webapp.presentation.TableServlet by thread http:18.- Choose Finish Debugging from the Debugging menu to end the debugging session.
- Click the Shutdown Server button to stop the application and shut down the server.
Figure 4.9 Debugging an application in Forte
![]()
To debug remotely using SocketAttach:
By default, when you start the Lutris EAS server with the
-debug
argument, the server is configured for debugging using socket transport. Socket transport uses standard TCP/IP sockets to communicate information between debugger applications and target VM. With the socket transport, the debugger application and target VM can reside either on the same machine or on different machines.
- To debug an application using SocketAttach, launch an instance of Lutris EAS locally with the following command:
multiserver -debugThe system will respond with the port assigned for debugging and then pause until you attach the debugger to the socket. For example, the system will return a line like the following:
Listening for transport dt_socket at address: 1029where
1029
is the port reserved for debugging. The server will remain paused until you attach to the VM at the specified port.- In Forte, attach to the VM.
- Choose Debug|Attach to VM from the menus.
- In the Attach to VM dialog, set the following options to start debugging:
Enter the name of the host upon which the Lutris EAS server was started (for example, localhost)
- Click OK to attach to the VM.
The EAS server will resume starting.
- Once the server has started, deploy and start the Kelp Sample Web application to debug.
When the core elements of the server have been loaded, a notice is printed to the console, indicating that the "Bootstrap process completed." When the bootstrap process is completed, you can attach to the server and deploy or undeploy applications and services.
- Open
TableServlet.java
in thekelp.webapp.presentation
package.- Locate the
for
loop of thecreatePage()
method and click the left edge of the editor to put a breakpoint on the line that readstable.appendChild(newRow);.
After you set the breakpoint, the line appears in red as shown in Figure 4.9.
- Access the application in a browser at http:/localhost:8002/webapp to exercise the code you are debugging.
- Click the Table Page link to trigger the breakpoint.
- When the breakpoint is reached, a message similar to the following is displayed in the Output Window in the Debugger section:
Breakpoint reached at line 85 in class kelp.webapp.presentation.TableServlet by thread http:18.- Choose Finish Debugging from the Debugging menu to end the debugging session.
Refer to the Deployment and Management Guide for additional information about managing your Lutris EAS server and deploying and undeploying applications.
To debug remotely using SharedMemoryAttach:
The shared memory transport SharedMemoryAttach method, available only on Windows. This method of debugging may be faster than SocketAttach. The shared transport uses Win32 shared memory primitives to communicate information between the debugger and the target VM.
Note: SharedMemoryAttach is only supported on the Win32 platform, and the debugger application and target VM must reside on the same machine.
- To debug an application using SharedMemoryAttach, launch an instance of Lutris EAS locally with the following command:
multiserver -debug -jdwp-args "transport=dt_shmem,server=y,suspend=n,address=fortedebug"- In Forte, attach to the VM.
- Choose Debug|Attach to VM from the menus.
- In the Attach to VM dialog, set the following options to start debugging:
fortedebug (this is the address specified in the command argument used to launch the Lutris EAS server)
- Click OK to attach to the VM.
- Deploy and start the Kelp Sample Web application to debug.
- Open
TableServlet.java
in thekelp.webapp.presentation
package.- Locate the
for
loop of thecreatePage()
method and click the left edge of the editor to put a breakpoint on the line that readstable.appendChild(newRow);.
After you set the breakpoint, the line appears in red as shown in Figure 4.9.
- Access the application in a browser at http:/localhost:8002/webapp to exercise the code you are debugging.
- Click the Table Page link to trigger the breakpoint.
- When the breakpoint is reached, a message similar to the following is displayed in the Output Window in the Debugger section:
Breakpoint reached at line 85 in class kelp.webapp.presentation.TableServlet by thread http:18.- Choose Finish Debugging from the Debugging menu to end the debugging session.
Refer to the Deployment and Management Guide for additional information about managing your Lutris EAS server and deploying and undeploying applications.
Debugging with JBuilder
The only requirement for debugging applications from JBuilder is that you must start the Lutris EAS server from your JBuilder project. Before you debug an application, make sure you can run the Kelp sample project successfully. To do this, you will need to run the XML Compiler and the Kelp Deployer.
To debug an application:
- Make sure the Lutris EAS server is not already running.
- Open the Kelp sample project.
- Open
TableServlet.java
in thekelp.webapp.presentation
package.- Locate the
for
loop of thecreatePage()
method and click the left edge of the editor to put a breakpoint on the line that readstable.appendChild(newRow);.
After you set the breakpoint, the line appears in red.
- From the menu, choose Run|Debug.
This starts the debugger. The debugger opens a command window even if you have selected Execution Log for console I/O.
- Open the table page in your browser by opening
http://localhost:8002
, where 8002 is the specified port and clicking Table Page.This triggers the breakpoint, as shown in Figure 4.10.
Figure 4.10 Debugging an application in JBuilder
![]()
You can set the value of
i
to4
to change the number of rows generated in the table. Your browser might time-out if you keep the program suspended for too long.
Copyright © 2000, 2001 by Lutris Technologies Inc. All rights reserved.