Introduction to Struts 2.0 Jenny Ni Joey Feng Winddays Wang Hewmmi Zhu Heather Lv Software School,Fudan University 1.

Slides:



Advertisements
Similar presentations
Struts 2.0.
Advertisements

Apache Struts Technology
Web MVC-2: Apache Struts Rimon Mikhaiel
MVC Frameworks Alternatives to coding the MVC pattern.
Struts1 Apache Struts Dr Jim Briggs. Struts2 What is Struts? Struts is an open source framework for building Java web applications Supports MVC/Model.
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
JavaServer Faces Dr Jim Briggs 1JavaServer Faces.
Pragmatic Application Building: Step by Step Jay Sissom Principal Systems Analyst Indiana University
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Apache Struts Technology A MVC Framework for Java Web Applications.
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
Session-02. Index. Jsp in Struts 2 Web.xml File in Struts 2.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Address - #22, 1 st Floor, Station View Road, Kodambakkam, Chennai JTech Soft Solutions Website:
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
Struts 2.0 an Overview ( )
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
Lecture 2 - Struts ENTERPRISE JAVA. 2 Contents  Servlet Deployment  Servlet Filters  Model View Controllers  Struts  Dependency Injection.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
Java Frameworks Indy Java Users Group January 29, 2003.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Basic Struts Architecture Client Server Database Request Response Control View Model Server Struts Framework.
Jakarta Struts Presented by Object Computing, Inc. (OCI) Written by Greg Elliott
8/15/2003System Specialists Corporation How to implement BC4J with the Struts Framework Eugene Sicat Technical Architect/Project Manager System Specialists.
Apache Struts RIFE Ruby on Rails Harry R. Erwin, PhD University of Sunderland CIT304/CSE301.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Fall CIS 764 Database Systems Design L8. Web ….
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
BOF # The Struts Framework Community The Struts Framework Community Craig McClanahan.
JAVA SERVER FACES ADITI RAJORIYA UNI – ar2630. POINTS TO BE DISSCUSED WHAT IS JSF? WHY JSF? ARCHITECTURE JSF VERSIONS UI COMPONENTS JSF STRUCTURE AND.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
Struts 2 introduction. Struts 2 framework Struts 2 A full-featured web application framework for the Java EE platform The Java Servlet API exposes the.
REVOLUTION TO NEXT GENERATION Struts2.0 20/02/ Avishek Arang ::
Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
Copyright AlphaCSP Israel 2008 – Web Framework Playoff Seminar 1 Struts2 Reinventing Struts1 Wheel Ori Dar Consultant and Architect, AlphaCSP.
Markus Hjort Reaktor Innovations Java Web Development T WWW-palvelun HUT
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
-SRINIVAS REDDY. Struts 2 Tutorial Introduction to Struts 2.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
13 Copyright © 2004, Oracle. All rights reserved. Adding Validation and Error Handling.
Struts Framework Day-2 Ashok Chakravarti. DataSource Usage Sample Struts-config.xml …
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
Chapter 2 Java Struct 2. Content Basic MVC Architecture Struts 2 Overview Struts 2 - Architecture.
Ashley Montebello Katie Githens Wayne Rowcliffe. Project Overview Create graduate student review system for ECpE department Review system is used by students.
Apache Struts Technology A MVC Framework for Java Web Applications.
J AVA T RAINING IN A HMEDABAD By TOPS Technologies 1 TOPS Technologies Java Course.
Model View Controller. MVC is the separation of model, view and controller. It's simply a paradigm; an ideal that you should have in the back of your.
V Web Tier Architecture MVC and Struts. v First, there were servlets And things were good Faster than CGI programs More scalable with built-in.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
Enterprise Java v050228MVC1 Model, View, Controller Web Architecture.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
Best Struts 2 Training By TOPS Technologies.
Unit 6-Chapter 2 Struts.
Introduction to Struts
The Model Layer What is Model?
Struts BY: Tejashri Udavant..
Presentation transcript:

Introduction to Struts 2.0 Jenny Ni Joey Feng Winddays Wang Hewmmi Zhu Heather Lv Software School,Fudan University 1

1. What is Struts? 2. Why to use framework? 3. Struts 2.0 Overview 4. Struts 2.0 MVC components 5. Request Lifecycle in Struts 2 6. Struts 2.0 Architecture 7. Sample Application 8. Why we should use Struts 2.0? 9. Struts 1.x vs Struts What you need to start using Struts2.0 Contents Software School,Fudan University 2

 Open Source java framework for creating web applications.  Action Based Framework  Create web application using MVC 2 architecture  Apache Struts offer two major version  Struts 1.x  Struts 2.0  Struts 2 = WebWork + Struts What is Struts? Software School,Fudan University 3

 Do we need framework?  No and Yes.  No.  In small applications where you don’t want the overhead of learning new things.  But  Yes  We have to use framework in real world application because:-  Automation of common tasks  Concentrate on higher level concerns. Why use framework? Software School,Fudan University 4

 Complete new framework based on webwork framework.  Struts 2.0 implements MVC 2 design pattern. Struts 2.0 Software School,Fudan University 5

 Controller:-  Filter Dispatcher:-  First component that start processing that is why this type of MVC is called front controller MVC  Looks at the request and apply the appropriate action.  Struts framework handles all of the controller work.  Its configured in web.xml  Interceptors:-  Can execute code before and after an Action is executed.  They can be configured per action basis.  Can be used for data validation, file upload, double submit guards. Struts 2.0 MVC Components Software School,Fudan University 6

 Model:-  Implemented by action class  For model you can use any data access technologies like JDBC,EJB,Hibernate  View  Its your result part. It can be JSP,JSTL,JSF etc.  Presentation part of the MVC Struts 2.0 MVC Components contd. Software School,Fudan University 7

1. User Sends Request 2. Filter Dispatcher determines the appropriate action 3. Interceptors are applied 4. Execution of action 5. Output Rendering 6. Return of Request 7. Display of result to user. Request Lifecycle in Struts 2.0 Software School,Fudan University 8

Struts 2.0 Architecture

Software School,Fudan University 10

1. Simplified Design 2. Simplified Action 3. Simplified Testability 4. Better tag features 5. Annotation introduced 6. Easy plug-in 7. AJAX Support Why we should use Struts 2.0? Software School,Fudan University 11

 How Struts 1.x and Struts 2.0 differ from each other? › Configuration › Action Class › Dependency injection. › Servlet Dependency › Validation › Threading model › Testability › Expression Language Struts 1.x vs Struts 2.0 Software School,Fudan University 12

Struts 1 Action  ActionForm  ActionForward  struts-config.xml  ActionServlet  RequestProcessor  Struts 2 Action Action or POJO’s Result struts.xml FilterDispatcher Interceptors

1. Java Tomcat 5.x(Servlet api 2.4 and jsp api 2.0) What you need to start using Struts 2.0? Software School,Fudan University 14

Let’s see something real… Software School,Fudan University 15

Web, Mail 2000

Web, Mail 2009

Struts Plugins

Simple Example

Name: Date: Struts 1

Invitees: <html:select property="invitees" multiple="true"> <html:options collection="employees" property="value" labelProperty="label"/>

Description: <html:textarea property="description" rows="4" cols="50" />

...  Only four pages! Save

<s:textarea label=”Description” name="description" rows="4" cols="50" /> Struts 2

Example Revisited

<s:textfield label="Name" name="name" tooltip="Meeting name" />

<jsp:include page="/ajax/commonInclude.jsp"/>... <s:textarea theme="ajax" label="Description" name="description" rows="4" cols="50" />

But there's more...

Brian Kernighan Law of Debugging Difficulty Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

Prevention and Cure

struts.devMode = true

Built-in Testing Support public class MyActionTest extends StrutsTestCase { public void testExecute() throws Exception { assertTrue(true); }

any.action?debug=console

any.action?profiling=yes

Time to Upgrade?

Tutorials, Guides, and FAQs

Struts 2 Training Course

<action name="editGangster" class="org.apache.struts2.s1.Struts1Action"> com.mycompany.gangstas.EditGangsterAction gangsterForm.jsp Run Struts 1 Actions as Is

How do I get started?

Where We are Going