The Front End
Once you have a model and business logic in place, you can develop a suitable front-end web application. When building your front end, use the Spring MVC framework to separate the model, the view, and the controller parts.
SAP Commerce provides a range of Accelerator storefronts. Accelerator gives you basic building blocks that you can use for developing sophisticated and responsive storefronts within specific commerce domains. But to illustrate the basics of how stores are constructed, you focus here on two aspects.
- The Controller Class
- The interface between the user action and the underlying model.
- JSP Pages
- Dynamic web pages for presenting data to the end user.
You have previously created the model aspect of your MVC architecture, now you create the view, the JSP pages, and the controller, the controller class.
Build a Web App Component Using Spring MVC
Develop a simple front-end store and get the basics for understanding how stores are constructed.
Prerequisites
public void testWebAppComponent() throws Exception {
canLoginToHybrisCommerce();
navigateTo("https://localhost:9002/concerttours/bands");
waitFor("a","The Quiet");
navigateTo("https://localhost:9002/concerttours/bands/A007");
assertTrue( waitFor("p","English choral society specialising in beautifully arranged, soothing melodies and songs"));
}
Before you begin this step, run the test to confirm that it fails by executing this command:
cd $HYBRIS_HOME_DIR/hybris123; mvn -Dtest=com.hybris.hybris123.runtime.tests.Hybris123Tests#testWebAppComponent test
cd %HYBRIS_HOME_DIR%\hybris123 & mvn -Dtest=com.hybris.hybris123.runtime.tests.Hybris123Tests#testWebAppComponent test