The Spring Framework is a lightweight, open source programming and
configuration model for developing Java based enterprise applications. This framework is used in
WebSphere Commerce for building and configuring Management Center, including the managing
of URL requests from Management Center to retrieve and process object data.With
Management Center built with the Spring framework, which includes built-in best practices and
design patterns, your site developers can customize Management Center more easily. Developers
can focus more on application-level programming to meet business needs when customizing Management Center and less on the underlying infrastructure of Management Center.
The Spring framework is a modular framework for building enterprise applications and includes
many different modules. Within
WebSphere Commerce, the following Spring framework layers and
modules are used to build
Management Center:
- The Core Container layer, specifically the spring-core,
spring-beans, spring-context, and
spring-expression modules. The spring-core and
spring-beans modules are the fundamental parts of the Spring framework. All
other Spring framework modules are built upon these core modules. These modules provide the
Inversion of Control (IoC), dependency injection, and Spring bean features of the framework, which
are used in WebSphere Commerce. The Spring framework uses the
spring-context module to access objects and adds support for internalization.
This module also supports the use of Java EE features, such as EJB, within the framework. The
spring-expression module provides the expression language that the framework
uses to query and process a bean object.
- The Spring web layer, specifically the spring-web, and
spring-webmvc modules. The spring-web module provides the
basic web-specific integration features that are required by Management Center. The framework
uses this module to initialize the Spring IoC container. The spring-webmvc
module, which is also known as the Spring Web-Servlet module, provides the
Spring Model-View-Controller (MVC) framework that WebSphere Commerce uses with Management Center. The spring framework MVC can be used with a servlet or portlet environment. The MVC
framework that is used in WebSphere Commerce is non-portlet. The MVC framework that is used in
WebSphere Commerce uses the Spring dispatcher servlet
A Spring bean is an element is defined in a Spring framework configuration file. These bean
definitions define the
Management Center objects that are managed by the Spring framework IoC
container. The framework can instantiate or destroy these bean objects as needed, and uses the beans
to create class instances. The bean definitions, which are also called controller configurations
within
WebSphere Commerce, include the properties and dependencies that the Spring framework
uses to create, update, and delete the bean objects. The attributes, properties, and dependencies in
each configuration must define the following information for the Spring bean object:
- The associated controller (application) class to use to retrieve or process the bean object or
service URL request from Management Center. Each bean must map to a class with the
package-qualified class name.
- The unique identifier for the controller configuration bean element. This identifier is used by
the framework to identify the configuration. The identifier also maps the bean object to an object
definition or search definition for the Management Center object or service.
- The properties that are to be used to define how the associated controller class is to process
the URL request and use the bean object.
- The dependencies that reference other beans or resource bundles that are needed for the class to
handle the bean object and URL request.
- Any other configuration settings or parameters to include within the bean object.
WebSphere Commerce currently uses the Spring framework 4.1.7 release. For more information
about this version of the Spring framework, including the framework layers and modules that are used
in WebSphere Commerce, and Spring beans, see Spring framework 4.1.7 release.
For more information about the Spring framework in general, see Spring framework.
Spring MVC framework
The Spring MVC framework is request-driven framework that uses a central dispatcher servlet to
handle the URL requests from Management Center. This Spring DispatcherServlet
dispatches requests to the controller classes that are identified within bean definition controller
configurations for retrieving and processing data.
The Spring MVC framework is composed of the following parts:
- Model, which represents the business or database code; the actual Management Center object
data. The Model object is a map interface, which the framework transforms into the XML formatted
View that is expected by Management Center. The framework uses the appropriate serialization
JSP fragments identified by the Controller to transform the Model to create the View.
- View, which represents code for designing the XML-formatted response of the Model that displays
to Management Center users.
- Controller, which represents the controller class that retrieves or processes the data to
generate the Model. The Controller receives a URL request from Management Center and uses the
corresponding controller configuration to generate the Model and select the JSP file to use to
transform the Model into the View.
For more information about the MVC framework, see Spring MVC framework.
For more information about the Spring dispatcher servlet, see Spring class DispatchServlet.
Changes from WebSphere Commerce Version 7 to Version 8
In Version 7, WebSphere Commerce used the Apache Struts framework for building all front-end
tooling, including Management Center. In Version 8, the Struts framework is no longer used for
building Management Center. Instead, all files that used the Struts framework within the
LOBTools web project for Management Center are replaced with files that use the Spring
framework. The move to using the Spring framework improves the underlying architecture of Management Center and makes it easier for developers to focus more on application-level business logic
instead of the infrastructure when customizing Management Center.
The Struts framework is still used for the following tools and projects in Version 8:
- CommerceAccelerator (WebSphere Commerce Accelerator)
- OrganizationAdministration (Organization Administration Console)
- SiteAdministration (Administration Console)
- Rest
- Search
- Stores
For more information about the use of the Struts framework in
WebSphere Commerce, see
WebSphere Commerce Struts framework.
Important: With the move from using the Struts framework to the Spring framework, you
cannot migrate any Version 7 Management Center customization to the Version 8 Management Center. You must either create your customization again within the Version 8 Management Center framework, or export your Version 7 Management Center
LOBTools.war to your Version 8 environment.
Customizing the Management Center Spring framework definitions
All major aspects of the
Management Center web application are configured within Spring
framework configuration files.
WebSphere Commerce uses multiple Spring definition files to
configure
Management Center. A different configuration file is used for mapping the
configurations for each
Management Center component. There is also an extension configuration
file for you to use to define your own custom mappings for custom objects or to override existing
mappings in the configuration files that are provided by
WebSphere Commerce.
- A spring-ibm-component.xml file is provided for each
Management Center component to define the URL mappings that are required for retrieving and
processing data for the component objects. For example, the
spring-ibm-catalog.xml file defines the mappings for the catalog
component.
- A spring-extension.xml file is provided for you to use to override existing
mappings or to define mappings for custom objects and views. Do not modify any
spring-ibm-component.xml files. Use only the
spring-extension.xml file to change or define mappings.
All Spring configuration files are included within the
LOBTools project in
IBM WebSphere Commerce Developer environments and in the
LOBTools web module in other
WebSphere Commerce environments. When you are working within the Enterprise Explorer view in
IBM WebSphere Commerce Developer, you can find these configuration files in the following directory:
For more information defining your own custom controller configurations in the extension file,
see Customizing controller configurations.