Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

The ActionForm Class Part 2-Java Programming-Lecture Handouts, Lecture notes of Java Programming

This is an Introductory course of Java Web Programming focusing on writing maintainable extensible code, methods of debugging, logging and profiling. The Java Technology used is J2EE an Enterprise Application Development tool. This lecture handout includes: Action, Form, Struts, Class, Validation, Interface, Server, Business, Processing, Logic, Web, Application

Typology: Lecture notes

2011/2012

Uploaded on 08/09/2012

dhanyaa
dhanyaa 🇮🇳

4.7

(3)

62 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download The ActionForm Class Part 2-Java Programming-Lecture Handouts and more Lecture notes Java Programming in PDF only on Docsity! The ActionForm Class In this lesson you will learn about the ActionForm in detail. I will show you a good example of ActionForm. This example will help you understand Struts in detail. We will create user interface to accept the address details and then validate the details on server side. On the successful validation of data, the data will be sent to model (the action class). In the Action class we can add the business processing logic but in this case we are just forwarding it to the sucess.jsp. What is ActionForm? An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side. We will first create the class AddressForm which extends the ActionForm class. Here is the code of the class: AddressForm.java package sturtTest; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.*; /** * Form bean for the Address Entry Screen. * */ public class AddressForm extends ActionForm { private String name=null; private String address=null; private String emailAddress=null; public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public void setAddress(String address){ this.address=address; } Comment [1]: start source code docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved