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
dollarToYen
business method of theConverterBean
class, you would follow these steps.- Edit
ConverterBean.java
. - Recompile
ConverterBean.java
by 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 ToolsDeploy. Make sure the checkbox labeled Save Object Before Deploying is checked. If you do not want to deploy at this time, select ToolsSave to save the search paths specified in step 5.
As a shortcut, you can select ToolsUpdate 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.jsp
file ofConverterApp
, be sure to type ant
converter
. The converter
task copies the index.jsp
file from the src
to the build
directory.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 ToolsUpdate 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 the ConverterBean
from ATypo
toMyConverter
, you would follow these steps.
No comments:
Post a Comment