Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
137
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Chapter 14: Java Code Generation and Reverse Engineering

Select the Deployment Descriptor option on the left side of the window to display the deployment descriptor options for the servlet, as shown in Figure 14.19. These parameters will be used to create the WAR file for the servlet.

Figure 14.19: Servlet Deployment Descriptor window

First, enter a descriptive name for the servlet in the Display Name field. Then, enter the security role(s) and the name and value of a context parameter, if any. Next, list the welcome files to include, enter the init parameter name and value, provide a session timeout value, and choose whether or not the servlet is distributable.

JAR and WAR Files

Java Archive (JAR) and Web Archive (WAR) files are used as containers for EJBs and servlets, respectively. To create a JAR file, select Tools → Java → J2EE → New ejb−JAR file. To create a WAR file, select Tools → Java → J2EE → New WAR file. The JAR or WAR specification window will appear. The JAR specification window is shown in Figure 14.20.

Figure 14.20: JAR Specification window

In the Java Archive Tool field, select the executable that will be used to create the JAR (if you are creating a WAR, select the executable that will be used to create the WAR). Enter the JAR or WAR name in the Name field. In the Java Class File(s) field, select the class(es) to include in the JAR or WAR. Finally, in the XML Deployment Descriptor(s) field, select the XML deployment descriptors to include.

488

Chapter 14: Java Code Generation and Reverse Engineering

Automated J2EE Deployment

In Rose 2001A, you can generate source code for Java classes. Deployment occurs manually after the generation. Rose 2002 automates the deployment of Java classes to WebLogic, WebSphere, and Sun Reference implementations. Follow the steps below to deploy Java classes.

1.

Start the J2EE Deployment Wizard by selecting Tools → J2EE Deploy → Deploy from the menu.

2.

Select the deployment target from the following list:

WebLogic 5.1

WebLogic 6.0

WebLogic 6.1

WebSphere 3.5

Web Server (J2EE 1.2)

3.

Select the working directory where temporary files will be stored.

4.

Select the directory for the Java class files.

5.

Check Edit XML Deployment Descriptors to customize XML deployment descriptor files prior to deployment.

Rose will display a Properties window for the selected deployment target. Specific information on the Properties window is dependent on the deployment target.

6.

Specify the property values, and then click Next.

7.

Rose will display a window prompting for the model elements to deploy.

8.

Select the model elements to deploy, and then click Next. Deployments to WebLogic and WebSphere can deploy EJBs and Java classes. Deployments to WebApplication can deploy web files, servlets, and Java classes.

Rose will display a summary screen.

9.

Review and make changes as needed prior to deployment.

489