Catálogo de publicaciones - libros

Compartir en
redes sociales


Beginning Apache Struts: From Novice to Professional

Arnold Doray

Resumen/Descripción – provisto por la editorial

No disponible.

Palabras clave – provistas por la editorial

Software Engineering/Programming and Operating Systems

Disponibilidad
Institución detectada Año de publicación Navegá Descargá Solicitá
No detectada 2006 SpringerLink

Información

Tipo de recurso:

libros

ISBN impreso

978-1-59059-604-3

ISBN electrónico

978-1-4302-0129-8

Editor responsable

Springer Nature

País de edición

Reino Unido

Fecha de publicación

Información sobre derechos de publicación

© Apress 2006

Tabla de contenidos

Introduction

Palabras clave: User Base; Validator Framework; Platform Independence; Extensive Infrastructure; Large User Base.

Part 1 - Basic Struts | Pp. 3-6

Servlet and JSP Review

Tomcat’s .\webapps directory is where you deploy your web application. Webapps are deployed as WAR files, which are just JAR files with a .war extension. WAR files contain a .\WEB-INF directory, with a web.xml file to configure Tomcat. Your Java classes and third-party JAR files go into WEB-INF\classes and WEB-INF\lib, respectively. Two very important servlet classes are HttpServletRequest and HttpSession.

Palabras clave: Java Code; User Session; Java Classis; Batch File; Apache Software Foundation.

Part 1 - Basic Struts | Pp. 7-16

Understanding Scopes

Scopes describe the lifetime and visibility of a variable. Session and request scopes are the most often used scopes. Session-scoped variables exist for the duration of a user’s session with the system. Request-scoped variables exist only for a single-page request, including redirects. Session-scoped variables are stored in an instance of HttpSession. Request-scoped variables are stored in an instance of HttpServletRequest. HttpServletRequest and HttpSession can be used to pass data between Java classes and JSPs.

Part 1 - Basic Struts | Pp. 17-21

Custom Tags

Custom tags are a central piece in Java-based web application frameworks. Custom tag functionality is implemented by your subclass of either TagSupport or BodyTagSupport. Use TagSupport if your custom tag doesn’t have a body and BodyTagSupport if it does. You need to declare your custom tag in a Tag Library Descriptor (TLD) file. You might have to register the TLD file’s location in web.xml.

Palabras clave: Uniform Resource Identifier; Integrate Development Environment; Batch File; Java Tool; Helper Class.

Part 1 - Basic Struts | Pp. 23-35

The MVC Design Pattern

The Model-View-Controller (MVC) design pattern brings many benefits to the webapp that implements it. Implementing MVC is difficult, which is why you need a web application framework like Struts. Struts only places restrictions on the View and Controller. You are free to implement the Model portion in any way you wish. Two very popular persistence frameworks are Hibernate and Torque.

Palabras clave: Design Pattern; Model Code; Business Logic; Java Object; Controller Code.

Part 1 - Basic Struts | Pp. 37-51

Simple Validation

ActionForm is the central class that for simple validation. Your ActionForm subclass must have getters and setters for each form property, and must override validate() to run simple validations. ActionErrors is the return value of validate() and holds error messages. Individual error messages are represented by instances of ActionMessage. The actual error message is stored in properties files.

Part 1 - Basic Struts | Pp. 53-65

Processing Business Logic

In this chapter, you’ve learned how business logic is processed by your Action subclass. The highlights of this chapter are as follows: org.apache.struts.action.Action subclasses must be stateless. You need to override just the execute() method of Action. Complex validation errors are flagged using the saveErrors() function. Redisplay of a page with errors is “manual.” Use mapping.getInputForward() to redisplay the input page. Use mapping.findForward(...) to display a named page.

Palabras clave: Data Transformation; Error Message; Business Logic; Instance Variable; Insufficient Fund.

Part 1 - Basic Struts | Pp. 67-77

Basic Struts Tags

In this chapter, you have seen how the basic Struts tags work to display form data and error messages. The Struts tags to display form data and error messages are in the HTML and Bean libraries. Forms have an associated form handler, which is a particular combination of ActionForm and Action subclasses. Form data is first passed through simple validation (ActionForm) before business logic is processed (Action). Struts handles the redisplay of badly filled forms and error messages for the necessary fields.

Palabras clave: Error Message; Business Logic; Input Field; Validation Error; Session Object.

Part 1 - Basic Struts | Pp. 79-91

Configuring Struts

In this chapter, you’ve learned the basics of configuring Struts: The struts-config.xml file ties together the View and Controller sections of your webapp. struts-config.xml is deployed in the \WEB-INF\ directory of your webapp. ActionForm subclasses are exposed to your webapp in the form bean declarations. A form handler declaration ties together form beans, an Action subclass, and one or more “next” pages. The properties files for your application are declared in the message resources section of struts-config.xml.

Palabras clave: Error Message; Exception Handler; Path Attribute; Property File; Controller Section.

Part 1 - Basic Struts | Pp. 93-105

More Tags

The Logic library has tags for iteration, conditional processing, and flow control. Most of these tags have JSTL equivalents. The Nested tag library is used to shift the implicit base object that the property attribute refers to. You can use nested properties to achieve a similar effect. JSTL consists of four tag libraries (Core, Formatting, XML Processing, and Database Access), which you can use in place of some Struts tags. <c:forEach>, <c:if>, <c:choose>...<c:when>, and <c:out> tags from the JSTL core tag library can be used to replace the Struts <logic:iterate> and conditional processing tags in the Logic tag library. <c:out> can be used to replace <bean:write>, but supporting tags from the JSTL Formatting tag library are needed to fully replace <bean:write>. EL is a way to give EL-enabled tags dynamic attributes. EL has several special keywords to help it do this. There are EL-enabled Struts tags you can use alongside the original Struts tags.

Palabras clave: Flow Control; Current Iteration; Index Property; Expression Language; Conditional Processing.

Part 1 - Basic Struts | Pp. 107-128