In this step you will create the Investigate page flow. A page flow is a Java class (with the JPF file extension) that controls how your web application functions and what it does. Page flows control all of the major features of a web application: how users navigate from page to page, user requests, and access to the web application's back-end resources.
Page flows control the features of a web application through the use of Action methods. An Action method may do something simple, such as forward a user from one JSP page to another; or it may do something complex, such as receive user input from a JSP page, calculate and/or retrieve other data based on the user input, and forward the user to a JSP page where the results are displayed.
The page flow you create in this step contains one simple Action method. This simple navigational Action method forwards users to the index.jsp page. In the next step, you will create a more complex Action method.
The tasks in this step are:
...on Linux
If you are using a Linux operating system, follow these instructions.
$HOME/bea/weblogic81/workshop/Workshop.sh
sh Workshop.sh
The application you create in this task contains resources for the page flow tutorial. The resources consist of the Invesitgate Java control (and its sub-components) and the Investigate web service. The Investigate Java control is a custom Java control that assembles a credit-worthiness report on loan applicants. The Investigate web service is a web service that gives web access to the Investigate Java control. For a detailed descriptions of these resources see Tutorial: Java Control and Tutorial: Web Service.
As you develop the Investigate page flow, you will deploy it to WebLogic Server to test its functionality. In this task you will start WebLogic Server to ensure that it is available during the development process.
You can confirm whether WebLogic Server is running by looking at the status bar at the bottom of WebLogic Workshop. If WebLogic Server is running, a green ball is displayed as pictured below.
If WebLogic Server is not running, a red ball is displayed, as pictured below.
If you see the red ball in the status bar, then follow the instruction below to start WebLogic Server.
You will develop your page flow within a Web Application project. This project has been pre-loaded into WebLogic Workshop as part of the new application you created above.
A new page flow, investigateJPFController.jpf, is created along with one JSP page, index.jsp. When you create a new page flow, it is automatically displayed in Flow View, a graphical representation of your page flow.
Flow View currently shows one Action method, named begin, and one JSP page, named index.jsp. The arrow, labeled "success", that points from the Action method to the JSP page tells you that the begin method is a navigational Action method: when the method is executed, it forwards users to the index.jsp page. (Not all Action methods are navigational: Action methods can do anything that a Java method can do.)
Every page flow must have a begin method. The begin method is the first method executed when your page flow is invoked by a web browser. When a user points a web browser at the page flow's URL
http://localhost:7001/PageFlowTutorialWeb/investigateJPF/investigateJPFController.jpf
the begin method will be executed and the user will be forwarded to the index.jsp page.
To see the source code for the begin method,
double-click the icon for the begin method.
The source code for the begin method is displayed in Source View.
Note that the begin method has two annotations within the Javadoc comment above the method signature: @jpf:action and @jpf:forward. Javadoc was originally introduced as a way to specify inline documentation that could be extracted and presented as HTML. WebLogic Workshop uses a variety of Javadoc annotations to indicate how code should be treated at compile time and at run time. The @jpf:action annotation declares that the method should be compiled as a Action method and that it should implement all of the functionality of an Action method. The @jpf:forward annotation declares that the method has navigational functionality. In this case, the @jpf:forward is able to forward users to the index.jsp page.
The begin method works as follows. (1) When the method is invoked, it returns a Forward object with the parameter "success". (2) The WebLogic Workshop runtime then searches for a @jpf:forward annotation that defines the destination corresponding to the parameter "success", in this case, the index.jsp page. When it finds the destination, it forwards the user to the index.jsp page.