Unit 6-Chapter 2 Struts.

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

Struts 2.0.
Lecture plan Information retrieval (from week 11)
Web Development with Karsten Schulz Terp-Nielsen Master Principal Sales Consultant Oracle Denmark.
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.
Layers & Tiers Umair Javed Lec - 41.
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
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.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Understanding and Managing WebSphere V5
Struts 2.0 an Overview ( )
Introduction to Struts 2.0 Jenny Ni Joey Feng Winddays Wang Hewmmi Zhu Heather Lv Software School,Fudan University 1.
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
1 CHAPTER 1 OVERVIEW of JDEVELOPER. 2 Overview of JDeveloper Oracle’s JDeveloper 10g (JDeveloper) is an integrated development environment for Java programming.
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
Jakarta Struts Presented by Object Computing, Inc. (OCI) Written by Greg Elliott
Standalone Java Application vs. Java Web Application
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
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 ….
Struts: An Insiders View October Abstract Struts is the de facto standard framework for Java web applications, but where did it come from, and where.
Introduction to Web Dimitar Nenchev Ivan Nakov
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
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)
Spring Framework. About spring Spring is the most popular application development framework for enterprise Java. Millions of developers around the world.
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.
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.
© 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.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Implementation Struts Framework for well-architectured web applications Model-View-Controller design pattern.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
Chapter 9 Web Application Design. Objectives Describe the MVC design pattern as used with Web applications Explain the role and responsibilities of each.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
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 
J2EE Platform Overview (Application Architecture)
APACHE TOMCAT WEB SERVER
Controlling an Application with Struts
Web Software Model CS 4640 Programming Languages for Web Applications
The J2EE Framework Java Technologies External Application.
Introduction to J2EE Architecture
Design and Maintenance of Web Applications in J2EE
Introduction to Struts
MSIS 655 Advanced Business Applications Programming
Building an Integrable XBRL Portal Daniel Hamm German Central Bank
The Model Layer What is Model?
JavaServer Faces: The Fundamentals
Struts BY: Tejashri Udavant..
Presentation transcript:

Unit 6-Chapter 2 Struts

Introduction Struts is an application development framework that is designed for and used with the popular J2EE (Java 2, Enterprise Edition) platform. Apache Software Foundation and comes with an Open Source license. The struts framework is an open source framework for creating well-structured web based applications. The struts framework is based on the Model View Controller (MVC) The struts framework is a complete web framework as it provides complete web form components, validators, error handling. Struts framework provides its own Controller component. It integrates with other technologies for both Model and View components. Struts can integrate well with Java Server Pages (JSP), Java Server Faces (JSF) technologies for View For Model, Struts works great with data access technologies like JDBC, Hibernate, EJB and many more.

How Does Struts Work? Struts is based on the time-proven Model-View-Controller (MVC) design pattern. The MVC pattern is widely recognized as being among the most well-developed and mature design patterns in use. By using the MVC design pattern, processing is broken into three distinct sections aptly named the Model, the View, and the Controller. These are described in the following subsections:

Struts 2 Features Configurable MVC components POJO based actions AJAX support Integration support Various Result Types Various Tag support Theme and Template support

Architecture Overview

All incoming requests are intercepted by the Struts servlet controller All incoming requests are intercepted by the Struts servlet controller. The Struts Configuration file struts-config.xml is used by the controller to determine the routing of the flow. This flows consists of an alternation between two transitions: From View to Action : A user clicks on a link or submits a form on an HTML or JSP page. The controller receives the request, looks up the mapping for this request, and forwards it to an action. The action in turn calls a Model layer (Business layer) service or function. From Action to View: After the call to an underlying function or service returns to the action class, the action forwards to a resource in the View layer and a page is displayed in a web browser.

Basic Components of Struts The Struts framework is a rich collection of Java libraries and can be broken down into the following major pieces: Base framework JSP tag libraries Tiles plugin Validator plugin A brief description of each follows.

A) Base Framework The base framework provides the core MVC functionality and is comprised of the building blocks for your application. At the foundation of the base framework is the Controller servlet: ActionServlet

B) JSP Tag Libraries JSP tag libraries enable JSP authors to use HTML-like tags to represent functionality that is defined by a Java class.

C) Tiles Plugin With Tiles, JSP pages can be broken up into individual 'tiles' or pieces and then glued together to create one cohesive page.

D) Validator Plugin Struts comes packaged, as of version 1.1, with the Validator subframework for performing data validation. Validator provides a rich framework for performing data validation on both the server side and client side (browser).

Struts framework core components The Controller : The controller is implemented by a java servlet, this servlet is centralized point of control for the web application. The ActionServlet extends the javax.servlet.http.httpServlet class.

The struts-config.xml File This file contains all of the routing and configuration information for the Struts application. This XML file needs to be in the WEB-INF directory of the application. Path Type Name Scope Validate Input Forward

Action Classes It's the developer's responsibility to create these classes. They act as bridges between user-invoked URIs and business services. Actions process a request and return an ActionForward object that identifies the next component to invoke. They're part of the Controller layer, not the Model layer. An action class handles the client request and prepares the response. It also decides where the response should be forwarded. Basically an action class receives data from the presentation layer and forwards the data to the corresponding business layer.

View Resources View resources consist of Java Server Pages, HTML pages, JavaScript and Stylesheet files, Resource bundles, JavaBeans, and Struts JSP tags.

ActionForms These greatly simplify user form validation by capturing user data from the HTTP request. They act as a "firewall" between forms (Web pages) and the application (actions). These components allow the validation of user input before proceeding to an Action. If the input is invalid, a page with an error can be displayed.

Model Components The Struts Framework has no built-in support for the Model layer. Struts supports any model components:  JavaBeans  EJB  CORBA  JDO  any other

User clicks on a link in an HTML page. Servlet controller receives the request, looks up mapping information in struts-config.xml, and routes to an action. Action makes a call to a Model layer service. Service makes a call to the Data layer (database) and the requested data is returned. Service returns to the action. Action forwards to a View resource (JSP page) Servlet looks up the mapping for the requested resource and forwards to the appropriate JSP page. JSP file is invoked and sent to the browser as HTML. User is presented with a new HTML page in a web browser.