#usernavbar()

Struts

DIDO -- Digital Images Delivered Online DLC -- Digital Library of the Commons Hohenberger Photographs Lilly Sheet Music U.S. Steel Cushman Victorian Women Writers Project Variations2 Wright American Fiction Project Hoagy Carmichael Collection
Skip to end of metadata
Go to start of metadata
Digital Library Infrastructure

The open-source Struts framework, which is one of the most successful and popular Web-application frameworks available, provides key capabilities to the developer for building virtually any Web application - especially those that make use of JSP pages as their user interface technology. Struts can, however, interact with many other presentation technologies that include XML/XSLT and Velocity. Struts is more than a presentation framework, even though its focus is on the view and controller side of application building. It also provides services for configuration, internationalization, and application logic.

Current usage

For the DLP Infrastructure Project, we have not yet defined a set of supported versions.

Eric has installed/tested:

  • Struts 1.1
    • Unsure of Struts 1.2 implications.

Struts basics

The flow of control in a Struts app looks like:

  • the URL (x.do) maps to the Struts ActionServlet (via web.xml)
  • ActionServlet looks at the struts-config.xml to determine where the flow goes
  • in struts-config.xml, an action mapping connects:
    • path = x.do = the command from the URL
    • input = x.jsp = the web page to display to get user-input information
    • attribute/name = xForm = a java bean to store form submission results. This may be created dynamically with DynaForm, or may have more implementation details in a real class. See the form-bean in struts-config.xml for details.
    • type = xAction = a java class to process the form's data (or simply data in the URL) and return a status code
    • forward = yy = a new URL/command to redirect to, based on the status code that comes from the Action
  • No labels