Problem solve Get help with specific problems with your technologies, process and projects.

Use the Struts framework to build Web applications

What the framework is and how to apply it

This tip focuses on an open source toolkit provided by the Apache group through their Jakarta project. Struts is...

a Java implementation of the Model-View-Control design pattern. Simply put, Struts allows developers to build applications for the Web that can be easily maintained over time by people with varied skill sets.

In my last tip, I showed how to call the JCo connector for SAP directly through a Java Server Page. While this very quickly showed how to use JSPs to connect to SAP, the example did not demonstrate good design practice. By integrating our presentation layer (the Web page display) with our connector layer (JCo) we force our Web designers to have a high degree of Java and SAP knowledge. Moreover, in the long term, our sample application will not be able to scale with growing Internet traffic, and will eventually crash under any degree of load. So, as we develop our Web application, we need to focus on good design practices that will: a) allow the application to be maintained and supported over time and b) can grow with our needs as more and more users ramp up on the Internet. Struts represents a "best practices" framework that enables us to create an application based on proven system solutions, otherwise known as design patterns.

Check out: http://Jakarta.apache.org/struts/index.html for additional information as well as the Struts download. In coming articles, I will focus on installing Struts within the Tomcat Java application server, building a sample application, and configuring screen and workflow through standard XML interfaces.

As you review the Struts documentation a few points to keep in mind. We will be using Struts Action classes to wrapper our calls to SAP's JCo. These classes will also maintain any additional business logic, such as tying together disparate calls to SAP BAPIs and RFCs. Action classes allow us to build the bulk of our Java programming then expose these as simple interfaces to the Web developer through the Struts framework. Likewise, when you look at the XML configuration file, start thinking about what your screen flow will look like and perhaps even begin storyboarding your Web site.

In part 2 of this tip, we will install Struts within a Java application server and take a more detailed look at the components that make up Struts.

Author Austin Sincock is product manager for ROBUSTA(tm), Gamma Enterprise Technologies Web sales solution for SAP.


This was last published in April 2002

Dig Deeper on SAP Web applications

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close