Subscribe

Subscribe today and receive our blog updates in your Inbox.

×

Struts

Struts

strutsStruts is an application development framework that is designed for and used with the popular J2EE (Java 2, Enterprise Edition) platform. It cuts time out of the development process and makes developers more productive by providing them a series of tools and components to build applications with. It is non-proprietary and works with virtually any J2EE-compliant application server.

Struts is based on the Model-View-Controller (MVC) design pattern. The MVC pattern is widely recognized as being well-developed and mature. By using the MVC design pattern, processing is broken into three distinct sections aptly named the Model, the View, and the Controller. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code.

MVC Design Pattern

Model Components provide a “model” of the business logic or data behind a Struts program. Model components provide interfaces to databases or back-end systems. Model components are generally standard Java classes. There is no specifically required format for a Model component, so it may be possible to reuse Java code written for other projects.

View Components are those pieces of an application that present information to users and accept input. In Struts applications, these correspond to Web pages. View components are generally built using JavaServer Page (JSP) files. Struts provides a large number of “JSP Custom Tags” (sometimes referred to as Struts Tags) which extend the normal capabilities of JSP and simplify the development of View components.

Controller Components coordinate activities in the application. One of the major contributions of Controller components is that they allow the developer to remove much of the error handling logic from the JSP pages in their application. Controller components in Struts are Java classes and must be built using specific rules. They are usually referred to as “Action classes.”

The inherent advantage of using the Struts is that you get a ready-made design pattern implementation and a robust, flexible framework.

  • Custom class based controlling components
  • Population of Java Beans through HTML form elements and their validation
  • XML based configuration for all underlying components
  • Full support for internationalization through provision of resource bundles for all the HTML elements
  • Tag libraries for easy integration with your existing JSP’s
  • An elegant way of handling form related errors.

Struts falls under the Jakarta subproject of the Apache Software Foundation and is a free, open-source, MVC framework for creating elegant, modern Java web applications.

More Info

Back