Jakarta-Struts 1.2 Tutorial

Peter Kitson

ISBN : -

Order a printed copy of this book from Amazon --UNAVAILABLE--


Cover Design - Jakarta-Struts 1.2 Tutorial
 

For your free electronic copy of this book please verify the numbers below. 

(We need to do this to make sure you're a person and not a malicious script)

Numbers

 




Sample Chapter From Jakarta-Struts 1.2 Tutorial
     Copyright © Sun Microsystems Press



What is Apache Struts?


• An MVC Framework?
– Struts provides a unified framework for deploying servlet
and JSP applications that use the MVC architecture.

• A Collection of Utilities?
– Struts provides utility classes to handle many of the most
common tasks in Web application development

• A Set of JSP Custom Tag Libraries?
– Struts provides custom tag libraries for outputting bean
properties, generating HTML forms, iterating over
various types of data structures, and conditionally
outputting HTML.

• But which is the proper way to view Struts?
– The answer depends on what you are going to use it for,
but the MVC framework is the most common way of
looking at Struts.

Advantages of Struts (vs. MVC Using RequestDispatcher)


• Centralized file-based configuration
– Rather then hard-coding information into Java programs, many
Struts values are represented in XML or property files. This loose
coupling means that many changes can be made without modifying
or recompiling Java code, and that wholesale changes can be made
by editing a single file. This approach also lets Java and Web
developers focus on their specific tasks (implementing business
logic, presenting certain values to clients, etc.) without needing to
know about the overall system layout.

• Form beans
– In JSP, you can use property=\'*\' with jsp:setProperty to
automatically populate a JavaBean component based on incoming
request parameters. Apache Struts extends this capability to Java
code and adds in several useful utilities, all of which serve to greatly
simplify the processing of request parameters.

• Bean tags
– Apache Struts provides a set of custom JSP tags (bean:write, in
particular) that let you easily output the properties of JavaBeans
components. Basically, these are concise and powerful variations of
the standard jsp:useBean and jsp:getProperty tags.