The J2EETM Tutorial
Home
TOC
Index
PREV TOP NEXT Search
Feedback

Modifying the J2EE Application

Since the J2EE SDK is intended for experimentation, it supports iterative development. Whenever you make a change to a J2EE application, you must redeploy the application.

Modifying a Class File

To modify a class file in an enterprise bean, you change the source code, recompile it, and redeploy the application. For example, suppose that you want to change the exchange rate in the dollarToYen business method of the ConverterBean class:

  1. Edit ConverterBean.java.
  2. Recompile ConverterBean.java by typing ant converter.
  3. In deploytool, select ToolsUpdate Files.
  4. A dialog box appears reporting the changed file. Verify that ConverterBean.class has been changed and then dismiss the dialog box.
  5. Select ToolsDeploy. Make sure the checkbox labeled Save Object Before Deploying is checked.

You can also perform steps 4 and 5 by selecting ToolsUpdate And Redeploy. The deploytool utility replaces the old JSP file in ConverterApp.ear with the new one and then redeploys the application.

Adding a File

To add a file to the EJB JAR or WAR of the application, perform these steps:

  1. Select the JAR or WAR.
  2. Select the General tab.
  3. Click Edit.
  4. In the tree of the Available Files field, locate the file and click Add.
  5. Click OK.
  6. From the main toolbar, select ToolsUpdate And Redeploy.

Modifying the Web Client

To modify the Web client, follow these steps:

  1. Edit index.jsp.
  2. Execute ant converter to copy the modified file to the build directory.
  3. In deploytool, select ToolsUpdate Files.
  4. A dialog box appears reporting the changed file. Verify that index.jsp has been changed and then dismiss the dialog box.
  5. Select ToolsDeploy. Make sure the checkbox labeled Save Object Before Deploying is checked.

You can also perform steps 4 and 5 by selecting ToolsUpdate And Redeploy. The deploytool utility replaces the old JSP file in ConverterApp.ear with the new one and then redeploys the application.

Modifying a Deployment Setting

To modify a deployment setting of ConverterApp, you edit the appropriate field in a tabbed pane and redeploy the application. For example, to change the JNDI name of the ConverterBean from ATypo to MyConverter, you would follow these steps:

  1. In deploytool, select ConverterApp in the tree.
  2. Select the JNDI Names tab.
  3. In the JNDI Name field, enter MyConverter.
  4. From the main toolbar, select FileSave.
  5. Select ToolsUpdate And Redeploy.
Home
TOC
Index
PREV TOP NEXT Search
Feedback