












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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 includes: Struts, Model, View, Controller, Tag, Library, Internationalization, Error, Handling, MVC, Flexible, Extensible, Actionform, Class, Action, Logon, Developer
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













docsity.com
Provided by developer Define an ActionForm bean (that is, a Java class extending the ActionForm class) for the input form Define it in struts-config.xml file name attribute of class Contains only property getter and property setter methods for each field-no business logic Provides standard validation mechnism
For each ActionForm bean defined in servlet- config.xml file, Controller (ActionServlet) will Check session scope for an instance of ActionForm bean If it does not exist, controller creates one Call corresponding setter method of ActionForm bean for every request parameter whose name corresponds to the name of a property of the bean Pass the updated ActionForm bean object as a parameter to execute() method of Action class
1.<%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> **** Submit example **** Example Submit Page **** **** Last Name: Address: 1.Sex: Male Female Married: **Age: ** ** 0 - 19 ** ** 20 - 49 ** ** 50 - ** **** **** source: Keld Hansen docsity.com
source: Keld Hansen docsity.com
Instead of creating a new ActionForm subclass and new get/set methods for each of your bean's properties, you can list its properties, type, and defaults in the Struts configuration file Use DanaActionForm whenever possible We will learn more about this in Advanced Struts session
Focus on control flow Process client request by calling other objects (BusinessLogic beans) inside its execute() method Returns an ActionForward object that identifies a destination resource to which control should be forwarded to The detination resource could be JSP Tile definition Velocity template Another Action
Application needs to Authenticate a User Establish a User Session Error handling Develop a “LogonAction”
Extend org.jakarta.struts.action.Action Override execute() method (in Struts 1.1) perform() method (in Struts 1.0)