326 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
2. When you drop a JSP page, you should change its name to the name shown
not only in the figure, but prepend the module name as well. For example, use
/btt/bank/ui/struts/withdrawal/withdrawal.jsp instead of
withdrawal.jsp.
3. When you drop a form bean, you are prompted for a name and scope. Enter
withdrawalForm as name and select request as scope.
Components in gray are not yet implemented, meaning they are only available in
the Web diagram and not as an underlying file such as a Java class or JSP.
Designing the application flow
When the components are laid out, connect them to define the flow of the
application. Figure 8-70 on page 327 shows the layout with connections.
1. Create a connection from withdrawal.jsp to /withdraw action.
This should be done to indicate the action that will be invoked when the form
is submitted.
Select Connection from the palette, click withdrawal.jsp, and drag the
connection to the /withdraw action.
2. Create a local forward back to withdrawal.jsp.
This will be used to forward the user back to the log in page when business
exceptions occur in the log in action.
a. Select Connection, click the /withdraw action, and drag it back to
withdrawal.jsp.
b. Rename the forward to failure and press Enter.
3. Create a local forward to the result.jsp.
a. Select Connection, click the /withdraw action, and drag it to result.jsp.
Note: You should add /prepareWithdrawal action because you are using
Struts modules. If you do not have these prepare actions, and you go to the
JSP pages directly, the subsequent submit action /withdraw cannot be found
by the Struts framework. The root cause is that the Struts framework would
not have initialized the struts-btt-withdrawal.xml module. Thus, before going to
withdrawal.jsp by selecting the /prepareWithdrawal action, Struts framework
can initialize the withdrawal Struts module. Then, the submission from
withdrawal.jsp can correctly direct to the /withdraw action in the
struts-btt-withdrawal.xml module.