The hardware and operating system prerequisites for building and running the YourCompany sample application are the same as those that are specified for the IBM Rational Developer product. This scenario was originally developed for IBM Rational Application Developer. The instructions provided here should work for other IBM Rational Developer product configurations that include Page Designer and the other Web development tools.
In addition to IBM Rational Developer and its prerequisites, you need a back-end database installed in order to build and test the dynamic Web pages of the Your Company sample application. You can use one of the following databases:
You will need to install WebLogic Server 6.1 SP7, 7.0 SP5, or 8.1 SP3 as your application server.
Note: You only need to enable JDBC 2.0 if you want to explore the database features of the YourCompanyExample project and if you are using DB2 version 7.2 as your back-end database.
JDBC 2.0 allows Java applications to access relational and nonrelational database management systems. To ensure that JDBC 2.0 is enabled on DB2:
To ensure that the essential DB2 processes are running, issue the following command in a DB2 command window: db2start
Note: The Linux instructions in this scenario assume that you have
installed DB2 in the default location and accepted the default user ID.
To enable the JDBC 2.0 driver and create the database:
if [ -f /home/db2inst1/sqllib/java12/usejdbc2 ]; then . /home/db2inst1/sqllib/java12/usejdbc2 fi
if [ -f /home/db2inst1/sqllib/db2profile ]; then . /home/db2inst1/sqllib/db2profile fi if [ -f /home/db2inst1/sqllib/java12/usejdbc2 ]; then . /home/db2inst1/sqllib/java12/usejdbc2 fi
Once IBM Rational Deployment Toolkit for WebLogic Server has been installed, it is necessary to configure a server preference in IBM Rational Developer to give the toolkit access to server resources.
To create a WebLogic server runtime, do the following:
Tip: Set the highest J2EE version used for development to 1.3 since WebLogic Server only supports up to J2EE 1.3.
The YourCompanyExample project is a full featured, Web-based sample application that uses HTML pages, cascading style sheets (CSS) and Java Server Pages (JSP) to provide employees with common intranet services. The YourCo intranet site enables users to do these things:
In this part of the tutorial, you will build an entry page for a company intranet site similar to the entry page of the YourCo Web site. To get the correct look and feel, we will copy some files from the YourCompanyExample project into a separate, new project that you will create. As you work through the tutorial, you can refer back to the YourCompanyExample project to check your work.
When you start the workbench, one of several perspectives is displayed. Each perspective provides you with a specialized set of tools to support a different set of development tasks. When you create a new Web project or load a Web example project, the Web perspective opens and your focus is automatically switched. This perspective gives you easy access to the views and tools that you need to develop Web applications. Like many other menus, the File menu is context-sensitive so functions like creating new Web projects are easier to perform in the Web perspective.
To open the Web perspective:
The Web perspective opens and the
icon is added to the Perspectives shortcut bar of the workbench.
Because you will reuse some files from the YourCompanyExample project, you need to load that example. To load the YourCompanyExample project:
install_path\eclipse\plugins\com.ibm.etools.weblogic.scenario.yourco.doc\DefaultEAR.ear
The YourCompanyExample project is now loaded and is seen in the Project Explorer view. The project may have JSP compilation errors but we can ignore these since JSPs are compiled and validated by WebLogic Server during server publishing, not when a project is built. To remove the errors from the Problems view:
A README.htm file can be found in the YourCompanyExample project folder. This file explains the features of the YourCo intranet site and gives instructions for setting up and running the application. You do not need to work through these now, but you may want to use them in the future.
A hierarchical view of the project is displayed in the Project Explorer view.
Under the folder Enterprise Applications is a project called DefaultEAR. Enterprise Application projects store meta information about the projects that are associated with them. This information is used when you publish a Web project. Expand DefaultEAR, then META-INF to see the files that the project contains.
You can associate more than one Web project (also referred to as a Web module) with each Enterprise Application project. Open application.xml to view a list of files associated with the DefaultEAR project; click the Source tab to view the XML code.
Now that you have loaded the example, you can explore the application and view some of its files. To see an example of the kinds of pages you will be building:
Note: To quickly expand a project or folder, double click the project or folder name.
Design page: Enables you to edit files visually.
Source page: Enables you to edit source code directly.
Preview page:
Shows you a close approximation of what the Web page will look like when
it is viewed in a browser. You can also test links by clicking them in
the Preview page.
You can switch between pages at any time by clicking the tabs at the bottom of the editor area. When you have more than one file open, you can switch between them by clicking on the file name tabs at the top of the editor area.
Note: The location and appearance of the file name tabs is configurable. Select Window > Preferences > Workbench > Appearance for options.
Each file is displayed in the Page Designer page that you selected last. If it is not already selected, click the Design tab. Notice that the file contains a frameset. By default, the cursor is placed in the top left hand corner of the top frame.
Now that you have explored the Web perspective and the different Page Designer pages, the next step is to start building your own Web application.