Apache Struts: A.MANOJ KUMAR (08871A0508) Under The Guidence of K.Narahari (Asst - Professor, CSE Dept)

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

PROGRESSIVE SEMINAR ON

APACHE STRUTS
BY

A.MANOJ KUMAR (08871A0508) UNDER THE GUIDENCE OF K.NARAHARI (Asst.Professor,CSE Dept)

Web Server:

-In order to process the requests we are using the server side programming like servlets and jsp.

Model 1 architecture (MVC architecture)

Controller
Form submit HTTP Event

Business Layer

Servlets
Create/Set property

Browser

Forward

Model JavaBeans

View
HTTP Response

JSP HTML Style sheets

Get property

Struts MVC architecture:


create

Controller Http Event ActionServlet

Action Form
dispatch Business Logic
Action

Business Layer

Browser

forward

StrutsConfig. xml forward

create/set

Resource Bundle

Model JavaBeans

Http Response

View JSP

get

How to build a Struts application?


Build the Model Components (ActionForm Class)

Build the Controller Components (Action Class)

Build the View Components (JSPs)

Create the struts-config file

Update the web.xml file

Building an ActionForm:
The ActionForm (also called the form) is a data holder that contains the data entered trough an HTML form. The form should also contain the get & set methods for each property. The form may also implement a validate method to perform data entry validations before actually performing the requested action. To create a form, you will need to extend the class org.apache.struts.action.ActionForm

BUILDING AN ACTIONSERVLET

ActionServlet is used to control the request and send the appropriate response to that request. It transforms request parameters into ActionForm There is only one ActionServlet in the application.

Package is used org.apache.struts.action.ActionServlet

CREATE THE STRUTS-CONFIG.XML FILE


To allow for better reusability, all components in Struts are loosely coupled. To integrate the components you must create a config file (struts-config.xml)

Within this file youll define the action-mappings and form-beans. The action-mappings tell the ActionServlet which action classes to include within the application.
The form-beans define the ActionForm classes required within the application.

BUILDING A JSP
To create a JSP using Struts you will use the tag libraries provided by the Struts Framework. struts-logic.tld : This tag library contains tags that are useful in managing conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management. struts-html.tld : This taglib contains tags used to create struts input forms, as well as other tags generally useful in the creation of HTML-based user interfaces.

References:
1) Books: i) The complete reference struts, by James holms, 2nd Edition, TMH. ii) Struts: Kick start, by James turner, Kevin bedell, sams publishings. 2) Journals: i) Shu-qiang Huang, Huan-ming Zhang, Research on Improved MVC Design pattern Based on Struts and XSL, ISISE08 International symposium on information science and Engineering, 2008, ISBN: 978-1-4244-2727-4, pages: 451-455. 3) Websites: i)http://en.wikipedia.org/wiki/Java_struts ii)http://jakarta.apache.org/struts/

Thank you

You might also like