Learning Jakarta Struts 1.1 (1)
This article is the first half of the article about Jakarta Struts 1.1. Part of the article is from Sue Spielman's book "The Struts Framework: PRactical Guide for java Programmers (Morgan-Kaufmann) / Struts Framework Java Programmer's Practical Guide". This book is one of the first books on the market that provides a comprehensive and detailed introduction to Struts 1.1. You can contact Sue at sspielman@switchbacksoftware.com.
Last year, the Struts framework (a Jakarta kaiju project) has become the de facto standard for building web applications. Struts has proven itself to be a reliable framework based on the MVC pattern architecture and can be used in various systems. In fact, I was forced to come up with a reason why my development team and I would spend a cycle developing a custom MVC pattern framework for the project. This is a bit incomprehensible.
Struts v1.1 is the latest version of this framework. At the time of writing this article, Struts v1.1 is still in beta2, and the final version will be released soon. There may seem to be no reason why you should start learning to use v1.1 now, but why not; in fact, there are many reasons why we should use this version.
This article has two parts. In the first part here, we briefly introduce the integration and multi-application support of Jakarta universal library. The second part will focus on nested tag libraries, plug-in APIs, and exception handling declarations. The new version has made some important improvements to the framework, and you may want to start new development with this version. In fact, I highly recommend it. Maintaining backward compatibility with v1.0.2 has been a permanent goal of the Struts project participants, and they have done a great job with v1.1. At the end of this article, we will point out some issues that need to be paid attention to when upgrading from v1.0.2 to v1.1.
This article is not an introductory reading to Struts. We assume that you are already familiar with the various components of this architecture. If you need to take a look at the introductory introduction first, please read the three-part introduction to the Struts framework I wrote (http://www.onjava.com/pub/a/onjava/2001/09/11/jsp_servlets.Html).
UPDATE
There have been exciting features and improvements to Struts throughout the development of v1.1. We'll take turns introducing them, but first let's take a look at what's new.
The use of Jakarta general libraries, such as BeanUtil and Logging;
DynaActionForms can create dynamic action forms without writing any code;
Multi-application support allows the definition of multiple struts-config.xml configuration files;
Nested tags The library makes it easy to access the nested object system in JSP pages;
Tiles and Validator provide advanced templates and form validation expressions;
The plug-in API can enhance the functions of ActionServlet;
Exception handling statements enable Actions Don't worry about catching all exceptions.
Let’s take a look at each feature one by one.
Integration of Jakarta universal library
The Struts toolkit can solve the problems that constantly arise when creating web applications. Most of the classes in this package do not rely on the controller Servlet framework or custom tag libraries, so they can be used in general Java application programming. In the Struts 1.1 release, many classes in this package were ported to Jakarta's public projects. These classes include Bean tools, Collections, and Digester packages. The logging provided in Struts actually comes from public projects. The org.apache.commons.beanutils component encapsulates Java's Reflection and Introspection application programming interface (API). Using the classes in the beanutils package, you can dynamically call getter and setter methods without compiling unknown method names. These classes are called using Struts' custom tag library, so additional custom tags can be defined for your application. You may want to learn more about what is available in this package. Table 1 lists these.
Table 1: Common packages in Struts 1.1
BeanUtils assembles JavaBeans properties through reflection
ConvertUtils Converts string values into objects of specified classes
MappedPropertyDescriptor describes and maps properties
MethodUtils focuses on general methods rather than details such as attributes
PropertyUtils uses the Java Reflection application programming interface (API) to perform setter (setting value) and getter (getting value) operations on general properties
The Digester package provides rules based on XML documents. Doing this is very important to read the configuration file so that the object can be initialized correctly. This package makes it very simple for you to do things that would otherwise require you to have a deeper understanding of DOM or SAX processing. When the schema in the XML is validated, this can be done through the object mapping module, which specifies rules. This includes the ability to embed your own pattern matching engines, legal namespace handling, and RuleSets that encapsulate rules for use in multiple applications. The Digester package is useful if you explicitly read an XML file that does not need to be mapped to an appropriate Java object.
The above is the content of learning Jakarta Struts 1.1 (1). For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Principle analysis and practical exploration of the Struts framework. As a commonly used MVC framework in JavaWeb development, the Struts framework has good design patterns and scalability and is widely used in enterprise-level application development. This article will analyze the principles of the Struts framework and explore it with actual code examples to help readers better understand and apply the framework. 1. Analysis of the principles of the Struts framework 1. MVC architecture The Struts framework is based on MVC (Model-View-Con

Exploring the internal mechanism of the Struts2 framework Struts2 is a popular JavaWeb application framework that is widely used to develop Web applications based on the MVC architecture. It has made a lot of improvements and optimizations based on Struts1, providing more powerful and flexible functions. Before we delve into the inner workings of the Struts2 framework, we need to understand some basic concepts. The core of the Struts2 framework is MVC (Model-View-Controlle

With the popularity of the Internet and smart mobile devices, the development of web applications has become increasingly important. As an excellent cross-platform programming language, Java is favored by developers. In Java back-end development, using the MVC framework can help us improve development efficiency and reduce development costs. This article will introduce the MVC framework development of API using JavaApacheStruts. 1. MVC framework MVC (Model-View-Contro

The principle of the struts framework: By using Java Servlet/JSP technology, an application framework based on the MVC design pattern of Java EE Web applications is implemented. It uses one or more Action classes to process user requests and return the results to the user. Application of struts framework: 1. Build Web applications; 2. Process form data; 3. Integrate third-party libraries; 4. Implement internationalization; 5. Build RESTful API.

Introduction to the Struts Framework in Java Language With the gradual popularity of Web applications, such as Web websites and enterprise application systems, the JavaEE (Enterprise Edition) architecture has gradually become a mainstream choice. In the JavaEE architecture, due to the popularity of the MVC (Model-View-Controller) design pattern, the Struts framework has become one of the commonly used web application frameworks. In this article, we’ll take a closer look at

In-depth analysis of the working principle of the Struts2 framework Struts2 is an excellent Java Web application development framework. It provides a development method based on the MVC (Model-View-Controller) pattern to help developers build and maintain Web applications more quickly. Understanding the working principle of the Struts2 framework is very important for developers. This article will help readers gain an in-depth understanding of the working principle of the Struts2 framework through detailed analysis and specific code examples.

Detailed analysis of the implementation principle of the Struts2 framework. As a widely used JavaWeb application framework, the Struts2 framework's excellent design and performance make it a favorite tool for developers. Understanding the implementation principles of the Struts2 framework is of great significance to improving developers' understanding and application level of the framework. This article will analyze the implementation principles of the Struts2 framework in detail and provide specific code examples to help readers gain a deeper understanding of this framework. 1. Brief introduction of Struts2 framework

In-depth analysis of the principles and applications of the Struts framework Summary: The Struts framework is an excellent JavaWeb application development framework. It is based on the MVC design pattern and a series of tag libraries and interceptors, providing developers with a simple and standardized way. to build web applications. This article will provide an in-depth analysis of the principles and applications of the Struts framework, including the framework's working principle, main components, and sample code to demonstrate its specific applications. 1. Working principle of Struts framework Struts
