Overview
Struts is an open source framework for developing Java based web applications that has established itself as the de facto standard in its field. It was first released in 2001 and is publicly available via the Jakarta project (http://jakarta.apache.org). It provides an infrastructure for a model-view-controller (MVC) based web architecture that abstracts page routing into configuration files, provides a rich set of tag libraries and enables easy integration of JavaBeans. It can enhance productivity in the development and maintenance of web applications, and provides integrated support for important web site features such as input form validation and internationalisation. It can also be used in conjunction with other Java web application frameworks and libraries such as Tiles, JavaServer Faces (JSF) and the JavaServer Pages Standard Tag Library (JSTL). The course provides web application developers with the knowledge and skills to either build a new system or to enhance an existing application by using the Struts framework. The course labs will use the Tomcat web server and the Ant build tool.
Intended For
Web developers who already have some background in Java and web site technologies and who want to become more productive by using the de-facto standard Java web application framework.Web designers, web developers and other semi-technical webworkers who are interested in the visual front-end of websites. DHTML has application in intranets as well as the internet. Project managers may benefit too, as the subject matter is not highly technical but does reveal an enormous range of possibilites.
Prerequisites
Delegates should have a good knowledge of Java and be familiar with the general principles of web based development. Knowledge of server side Java components such as servlets and JSPs would be an advantage but is not essential since the course covers the necessary basics of these technologies. The course assumes some familiarity with the basics of HTML, XML and working with the Windows operating system command line.
Learning outcomes
At the end of the course, participants should have the following key skills:
- Work with the model view controller architecture of Struts
- Be able to configure page routing in a Struts web application
- Use Struts tag libraries for building web pages with dynamic content
- Integrate JavaBeans into a Struts-based web application
- Use the built in features of Struts for validation, logging and localisation
- Be aware of complementary web application frameworks and libraries
Content
Module 1: Web Applications
An overview of the J2EE architectures and components used to build web applications. Covers web servers, J2EE application packaging, dynamic content, servlets, JSPs and page routing. Includes discussion of key design patterns in web development, the Model 1, Model 2 (front controller) and MVC patterns. Lab sessions cover deployment of a simple non-Struts web application onto a Tomcat server using an Ant build file.
Module 2: Custom tag libraries
One of the key features of Struts is its tag libraries, so it is useful to have an understanding of tags and their usage prior to introducing the Struts tags. In this section the various tag types are introduced along with the JSP Tag API. Creating custom tags, packaging tags and parameterised tags are explained.
Module 3: JavaBeans and Maps
Another key component of the Struts framework is the JavaBeans API. This section covers those features of JavaBeans that are key to integrating them with JSP pages and Struts. Covers properties, accessors, naming conventions and related tags. Discusses reflection and introspection. Also covers the use of Maps to store data, and indexed and mapped properties. Discusses scope in the context of web applications.
Module 4: Struts intro
An overview of Struts and how it provides a framework for developing web applications. The various components of a Struts based web application are covered in summary, including configuration files, use of JavaBeans, the MVC architecture and tag libraries. Packaging of a Struts based web application is explained. Lab sessions cover deployment of a pre-built Struts based web application onto a Tomcat server using an Ant build file.
Module 5: Page routing with Struts
Using ActionForms, ActionMappings and Actions to control page routing within Struts applications without embedding routing behaviour in web pages. This section includes work with JavaBeans that represent the underlying data model to see how they integrate with Struts. Lab sessions explore how routing can be controlled using configuration files.
Module 6: HTML Tag libraries
One of the tag libraries provide with Struts includes special tags that make it easy to integrate Struts components with HTML pages. These include special form tags. This module covers Form and FormBean interactions.
Module 7: Validation
Using Struts to validate user input and correctly handle situations where input has to be re-entered.
Module 8: Managing Struts applications
Integrating J2EE declarative security into Struts authentication. Using Struts logging, internationalisation, localisation and resource files.
Module 9: Other related technologies
Struts is not the only web application framework. There are many others, some of which are alternatives but some that can be used in a complementary manner. In this section we explore some other tools that can be used in conjunction with Struts, including Tiles, JavaServer Faces (JSF) and the JavaServer Pages Standard Tag Library (JSTL).
Method Used
Each participant works at a PC and spends 60% of time in practical exercises. The workshops are based on a simple case study that is developed through a series of exercises. The emphasis is on using Struts to build a web application that is as transparent, maintainable and flexible as possible.


