BEA Logo BEA WebLogic Commerce Server Release Beta

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Commerce Server Doc Home   |   Tour of the JSP Templates   |   Previous Topic   |   Next Topic   |   Contents   |   Index

New User Buys a Product

 

In this section of the tour, assume that you want to buy a hammer for a home-improvement project. You have heard of a new e-commerce Web site with a huge selection and low prices, so you decide to visit it. Your trek through the site takes you along the following path:

 


New User Roadmap

Before starting this section of the tour, review the following maps of the JSP templates (Figure 3-1, Figure 3-2, and Figure 3-3). The arrows in the maps represent navigation options on the site; the darker arrows show the path that this section of the tour describes.

Figure 3-1 JSPs for Finding and Selecting an Item

Figure 3-2 JSPs for the Shopping Cart and New User Registration

Figure 3-3 JSPs for Completing the Order

 


Step 1: Search for Products

When you first access the site's home page, you notice that you could either browse or search through the product catalog. Because you are looking specifically for a hammer, and because you are unfamiliar with the scope of this new Web site, you decide to use the Quick Look-up box (see Figure 3-4).

Figure 3-4 Searching in main.jsp

To continue the tour...

On the home page, enter hammer in the Quick Look-up box. Then click Find.

 


Step 2: Select an Item

When you click Find, the WebLogic Commerce Server search engine queries the product catalog for items with keywords that match hammer and displays the results in searchresults.jsp (see Figure 3-5).

Features of searchresults.jsp

Figure 3-5 Search Results in searchresults.jsp

Notice the following features of searchresults.jsp:

To continue the tour...

Choose a hammer and click Add to Cart.

 


Step 3: View the Shopping Cart

When you click Add to Cart, WebLogic Commerce Server lists all items you have selected during the current visit to the site in shoppingcart.jsp (see Figure 3-6).

Features of shoppingcart.jsp

Figure 3-6 Shopping Cart

Notice the following features of shoppingcart.jsp:

For details on the shopping cart, see "Shopping Cart Management Services" in Order Processing Package.

Technical Note: Pipeline Components, Pipeline Sessions, and Webflow

So far this tour has focused on HTML elements and JSP tags, which WebLogic Commerce Server uses to present information in a format that Web browsers can display.

Behind this presentation layer, Pipeline components, Pipeline sessions, and Webflow exchange data with users, apply business logic and process data, maintain state in individual shopping sessions, and direct your users through the site based on a set of context-specific rules. The following list describes each of the mechanisms:

For example, Listing 3-1 shows JSP tags from shoppingcart.jsp that retrieve the contents of the shopping cart from the current Pipeline session. JSP tags that invoke Pipeline components start with the following string:
<pipeline:

Listing 3-1 JSP Tags for Retrieving Shopping Cart Content


<pipeline:getPipelineProperty propertyName="<%=PipelineSessionConstants.SHOPPING_CART%>" returnName="shoppingCart" returnType="com.beasys.commerce.ebusiness.shoppingcart.ShoppingCart"/>

<pipeline:getPipelineProperty propertyName="<%=PipelineSessionConstants.SAVED_SHOPPING_CART%>" returnName="savedShoppingCart" returnType="com.beasys.commerce.ebusiness.shoppingcart.ShoppingCart"/>


For more information on Pipelines and Webflow, see Webflow and Pipeline Management.

To continue the tour...

Click Check Out.

 


Step 4: Create a New User Profile

When you click Check Out from the shopping cart, WebLogic Commerce Server prompts you to log in from login.jsp. Because you are a new user, you must first create a user profile (see Figure 3-7).

Features of login.jsp

Figure 3-7 New User Logging In

To continue the tour...

Click Create to see the templates for creating a new user profile.

When you click Create on the Log In page, WebLogic Commerce Server prompts you to provide information for your user profile in newuser.jsp (see Figure 3-8 and Figure 3-9).

Features of newuser.jsp (Part 1 of 2)

Figure 3-8 Entering Address Information

Notice the following features of the first half of newuser.jsp:

Technical Note: Input Processors

Input processors are Java classes that handle form submission. Some may perform validation of customer data, but the primary role of an input processor is to store customer data into the Pipeline session for subsequent use by a Pipeline component. Webflow determines whether user input is directed to an input processor and where the input processor directs its output.

For example, Listing 3-2 is an excerpt from newuser.jsp specifying that when a user clicks the Save button, the browser posts data to the Webflow.

Listing 3-2 Form that Sends Data to an Input Processor


<!-- begin form to input customer data. This form posts to the Webflow Advisor a "button(save)" event from origin "newuser.jsp" -->

<form method="post" action="<%=WebflowJSPHelper.createWebflowURL(pageContext, "newuser.jsp", "button(save)", false)%>">

<input type=hidden name=origin value="newuser.jsp">

<input type=hidden name=event value="button(save)">


Listing 3-3 shows the excerpt from webflow.properties that directs information posted from newuser.jsp. In the excerpt, Webflow sends information to the newuser.CustomerProfile.inputprocessor; then it directs the results from the CustomerProfile input processor to the CustomerProfile Pipeline. If the input processor detects an error, it redisplays newuser.jsp and populates it with data from the current Pipeline session.

Listing 3-3 Webflow Sends Data to an Input Processor


# Process the data from the form

newuser.jsp.button(save)=newuser.CustomerProfile.inputprocessor

# And send it off to create the user

newuser.CustomerProfile.inputprocessor.success=CustomerProfile.pipeline

...

# On an error, bring them back to the newuser.jsp form. 
# It will be redisplayed with their old data and error messages added in.

newuser.CustomerProfile.inputprocessor.exception(InvalidInputException)=
commerce/register/newuser.jsp

CustomerProfile.pipeline.exception(PipelineFatalException)=commerce/register/
newuser.jsp


For a description of input processors that WebLogic Commerce Server provides, refer to the following documents:

More Features of newuser.jsp (Part 2 of 2)

Figure 3-9 Entering User Name and Password

Notice the following features of the second half of newuser.jsp:

To continue the tour...

Complete the required fields and click Save.

 


Step 5: Log In as a Registered User

When you click Save, WebLogic Commerce Server prompts you to log in from login.jsp (see Figure 3-10).

Features of login.jsp

Figure 3-10 Logging In

For a description of login.jsp, see Features of login.jsp.

To continue the tour...

Type the user name and password you entered with your new user profile. Then click Log In.

When you click Log In, WebLogic Commerce Server displays successfullogin.jsp (see Figure 3-11).

Features of successfullogin.jsp

Figure 3-11 successfullogin.jsp

Notice the following features of successfullogin.jsp:

To continue the tour...

Click the Checkout button.

 


Step 6: Choose Shipping Options

When you click Checkout, WebLogic Commerce Server starts the checkout process by displaying shipping options in shipping.jsp (see Figure 3-12).

Features of shipping.jsp

Figure 3-12 Choose Shipping Options

Notice the following features of shipping.jsp:

To continue the tour...

  1. Select shipping options. You may also enter a comment in the Special Instructions box.

  2. Click Continue.

When you click Continue, WebLogic Commerce Server displays your shipping addresses in selectaddress.jsp (see Figure 3-13).

Features of selectaddress.jsp

Figure 3-13 Select Shipping Address

Notice the following features of selectaddress.jsp:

To continue the tour...

Click Use.

 


Step 7: Enter Payment Information

When you click Use, WebLogic Commerce Server displays payment.jsp, which lists any credit cards that are in your user profile (see Figure 3-14).

Features of payment.jsp

Figure 3-14 Select Add Credit Card

Notice the following features of payment.jsp:

To continue the tour...

Click Add Card.

Features of paymentnewcc.jsp

When you click Add Card, WebLogic Commerce Server prompts you to enter payment information in paymentnewcc.jsp (see Figure 3-15).

Figure 3-15 Enter Credit Card Information

Notice the following features of paymentnewcc.jsp:

Technical Note: Templates Included Within Templates

Rather than repeating input fields and other information across several files, the WebLogic Commerce Server JSP templates assign re-used JSP tags and HTML elements to a set of include files, which are, in turn, JSP templates that you can use to develop your site. For example, paymentnewcc.jsp (described in the previous section), profilenewcc.jsp, and newuser.jsp are parent JSP pages that include newcctemplate.jsp as a child page to provide consistent input fields for credit card information. You can include newcctemplate.jsp in other JSP files that you create.

Why doesn't Webflow specify newcctemplate.jsp in all locations that request credit card information instead of using three files, paymentnewcc.jsp, profilenewcc.jsp, and newuser.jsp? Webflow uses the three parent JSP pages to determine a user's context and to determine which pages to display after a user enters new credit card information. For example, Figure 3-16 shows that after a user completes paymentnewcc.jsp, Webflow displays payment.jsp; after a user completes profilenewcc.jsp, Webflow displays viewprofile.jsp, and after a user completes newuser.jsp, login.jsp is displayed.

Figure 3-16 Template Include Files

For a list of include files and the JSP templates that use them, see Product Catalog Management and Order Processing Package.

To continue the tour...

  1. Enter information for a credit card.

    If you have enabled the CyberCash integration, you can use any of the following credit card types and numbers to test or demonstrate the integration:

  2. Complete the remaining required fields and click Save.

 


Step 8: Select a Credit Card

When you click Save in paymentnewcc.jsp, WebLogic Commerce Server displays your newly added credit card information in payment.jsp (see Figure 3-17).

More Features of payment.jsp

Figure 3-17 Select Credit Card

Notice the following features of payment.jsp:

To continue the tour...

Click Use.

 


Step 9: Purchase the Item

When you click Use in payment.jsp, WebLogic Commerce Server displays checkout.jsp, from which you review the tax information and complete the purchase.

Features of checkout.jsp

Figure 3-18 Purchase the Item

Notice the following features of checkout.jsp:

To continue the tour...

Click Complete Purchase.

 


Step 10: Review the Order Confirmation

When you click Complete Purchase, WebLogic Commerce Server completes the purchase and displays the confirmation number in confirmorder.jsp (see Figure 3-19).

Features of confirmorder.jsp

Figure 3-19 Review the Order Confirmation

Notice the following features of confirmorder.jsp:

To continue the tour...

This concludes the tour for new users. To continue the tour of the JSP templates, click Home in the navigation bar and go to the next section, Registered User Buys a Product.