29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.4.7 Struts<br />

Struts is an open-source framework for building MVC-based Web applications.<br />

Struts is part of the Jakarta project, sponsored by the Apache Software<br />

Foundation. The Struts framework provides the benefits of modularity, flexibility,<br />

and reusability of components, combined with the easy development associated<br />

with MVC-based Web applications.<br />

The goal of the Struts project is to provide an open-source framework useful in<br />

building MVC-based Web applications using servlet and JSP technologies. From<br />

an MVC point of view, Struts provides the following.<br />

► Model: nothing. The business logic must be provided by the Web application<br />

developer, usually as Java objects (JavaBeans or Enterprise JavaBeans).<br />

► View: an org.apache.struts.action.ActionForm class to create form beans that<br />

are used to pass data between the controller and the view. In addition, Struts<br />

provides custom tag libraries that assist developers in creating interactive<br />

form-based applications.<br />

► Controller: an org.apache.struts.action.Action class that developers use to<br />

create the classes that control the flow of the application. Also, Struts<br />

provides an org.apache.struts.action.ActionServlet class to implement a<br />

controller servlet.<br />

Struts also provides utility classes to support XML parsing, automatic population<br />

of JavaBeans properties based on the Java reflection APIs, and<br />

internationalization of prompts and messages.<br />

A typical Struts Web application has a single servlet that uses an XML file for<br />

configuration information. There will be multiple action classes and JSPs (using<br />

the Struts taglibs).<br />

For more information on Struts, we recommend the following:<br />

► Go-ForIt Chronicles, Part 19: Struttin' your stuff with <strong>WebSphere</strong> Studio<br />

tutorial from <strong>IBM</strong> DeveloperWorks. To see the list of tutorials, go to:<br />

http://www.ibm.com/developerworks/<br />

Select the <strong>IBM</strong> developer solutions product domain and then select<br />

Education.<br />

► For information on using Struts with <strong>WebSphere</strong> Studio products, see Legacy<br />

Modernization with <strong>WebSphere</strong> Studio Enterprise Developer, SG24-6806.<br />

Although written for the Enterprise Developer configuration of <strong>WebSphere</strong><br />

Studio, the information on Struts is also relevant for Studio Site Developer.<br />

► The Jakarta Struts home page at:<br />

http://jakarta.apache.org/struts<br />

36 <strong>IBM</strong> <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> - Express V5.0.2 Developer Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!