Level: Intermediate Mike Callaghan (mcallagh@ca.ibm.com), WebSphere Commerce Support Analyst, IBM N Krishnan (nkrishna@in.ibm.com), WebSphere Commerce Consultant, IBM Nicolai Nielsen (nicolai.nielsen@uk.ibm.com), WebSphere Commerce Consultant, IBM
03 Jun 2009 This tutorial will take you through an implementation of
WebSphere® Commerce storefront for a mobile device. It will show how to
create a servlet filter to detect the device used and then map to a specific
Struts action. It will also show how to cache based on the device
format.
Before you start
The current trend in online shopping has retailers targeting customers
wherever they are, whichever device they are on, rather than being
restricted to a traditional desktop. You will go through one
implementation of WebSphere Commerce specifically for a mobile device.
This tutorial highlights many of the key concepts of how to use
the WebSphere Commerce Struts framework to support different displays
for each mobile device. You will learn to implement a servlet filter to detect
each device and then map it accordingly to a new Struts action. You will
also force the display type based on your preference. Finally, you
will learn how to cache the pages based on the device format.
Objectives
- Implement a servlet filter to detect the type of device
submitting the request.
- Create views for specific devices.
- Switch between mobile and non-mobile views on the
storefront.
- Use Dynacache to cache the views based on device type.
Prerequisites
This tutorial is intended for WebSphere Commerce developers. Knowledge
of Struts, strorefront JSPs, and servlet filters is useful, but not
required.
System requirements
This tutorial requires the use of a mobile device simulator to test the
results. You will need to find a simulator, for example, by searching
for one via the Internet. We used an Apple® iPhone® simulator in our
practice. The assumption is that the simulator allows you to enter a
URL from the local server. This tutorial will provide the URLs to
enter into the mobile device simulator.
This tutorial will also assume an IBM WebSphere Commerce Developer v6.0
environment is being used. There is no dependent fixpack or feature
pack level.
The out-of-the box ConsumerDirect sample store is used throughout the
tutorial.
Duration
2 hrs
Getting started
Extract the provided
MobileCommerceCode.zip to a
temporary location because you will reference this location as
MobileCommerceCode\ from now on.
|