|
Home TOC Index |
|
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, if you want to change the exchange rate in the
dollarToYenbusiness method of theConverterBeanclass, you would follow these steps.
- Edit
ConverterBean.java.- Recompile
ConverterBean.javaby typingant converter.- In
deploytool, select ToolsUpdate Files.
- The Update Files dialog box appears. If the modified files are listed at the top of the dialog, click OK and go to step 6. If the files are listed at the bottom, they have not been found. Select one of those files and click Edit Search Paths.
- In the Edit Search Paths dialog, specify the directories where the Update Files dialog will search for modified files.
- In the Search Root field, enter the fully-qualified name of the directory from which the search will start.
- In the Path Directory list, add a row for each directory that you want searched. Unless fully-qualified, these directory names are relative to the Search Root field.
- Click OK.
- Select Tools
Deploy. Make sure the checkbox labeled Save Object Before Deploying is checked. If you do not want to deploy at this time, select Tools
Save to save the search paths specified in step 5.
As a shortcut, you can select Tools
Update And Redeploy. With this shortcut, the Update Files dialog box does not appear unless the files are not found.
To modify the contents of a WAR file you follow the preceding steps. The Update Files operation checks to see if any files have changed, including HTML files and JSP pages. If you change the
index.jspfile ofConverterApp, be sure to typeantconverter. Theconvertertask copies theindex.jspfile from thesrcto thebuilddirectory.Adding a File
To add a file to the EJB JAR or WAR of the application, perform these steps.
- In
deploytool, select the JAR or WAR in the tree.- Select the General tab.
- Click Edit.
- In the tree of the Available Files field, locate the file and click Add.
- Click OK.
- From the main toolbar, select Tools
Update And Redeploy.
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 theConverterBeanfromATypotoMyConverter, you would follow these steps.
|
Home TOC Index |
|
Search
Feedback |