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.

Slides:



Advertisements
Similar presentations
Introducing Mapbuilder Michael Adair Natural Resources Canada.
Advertisements

Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
Advanced Java Class Web Applications – Part 0 (Introduction)
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Tomcat Configuration A Very, Very, Very Brief Overview.
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.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
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.
Lecture 2 - Struts ENTERPRISE JAVA. 2 Contents  Servlet Deployment  Servlet Filters  Model View Controllers  Struts  Dependency Injection.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
WSDL: Web Services Definition Language CS 795/895.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Chapter 1: Introduction to Web Applications. This chapter gives an overview of the Internet, and where the World Wide Web fits in. It then outlines the.
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Basic Struts Architecture Client Server Database Request Response Control View Model Server Struts Framework.
Introduction to J2EE Architecture Portions by Kunal Mehta.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
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–
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
The Inter-network is a big network of networks.. The five-layer networking model for the internet.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Chapter 2 An Overview of Servlet and JSP Technology.
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.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Basics of Web Based Computing. The Architecture The user’s system A Web Server What’s inside? Server software Apache or other Resources to be accessible.
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.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
15 Copyright © 2004, Oracle. All rights reserved. Adding JAAS Security to the Client.
INFSO-RI Enabling Grids for E-sciencE Web Services Mike Mineter National e-Science Centre, Edinburgh.
Struts 2 Introduction.
Data transfer and type conversion One of the common tasks of the web application domain was moving and converting data from string-based HTTP to the various.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Chapter 2 Java Struct 2. Content Basic MVC Architecture Struts 2 Overview Struts 2 - Architecture.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
Chapter 13 Web Application Infrastructure
Java Web Services Orca Knowledge Center – Web Service key concepts.
J2EE Platform Overview (Application Architecture)
APACHE TOMCAT WEB SERVER
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
Tomcat Celsina Bignoli
By Dr. Kodge Bheemashankar G
Introduction to J2EE Architecture
Unit 6-Chapter 2 Struts.
Introduction to Struts
MSIS 655 Advanced Business Applications Programming
Using Servlet Contexts to Deploy Servlets
The Model Layer What is Model?
Objectives In this lesson you will learn about: Need for servlets
Web Servers (IIS and Apache)
Struts BY: Tejashri Udavant..
SDMX IT Tools SDMX Registry
Presentation transcript:

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 HTTP client / server protocol to the Java platform. Struts 2 is built on top of the Java Servlet API layer. A framework makes generalizations about the common tasks and workflow of a specific domain. It then attempts to provide a platform upon which applications of that domain can be quickly built.  Struts 2  Java Servlet specification  HTTP

History of Struts Struts 2 Is from Apache software foundation  ASF is a non-profit corporation (decentralized community of developers) supporting Apache software projects including the Apache HTTP server. Struts 2 is a brand new web application framework  It is not just a new release of the Struts 1 framework, but a completely new framework based on the OpenSymphony WebWork framework. Struts 2 implements the popular Model-View- Controller (MVC) design pattern. The MVC pattern provides a separation of concerns that applies well to web applications. Separation of concerns allows us to manage the complexity of large software systems by dividing them into high- level components

Struts 2 implementation of the MVC Pattern  HTTP request  Web browser  client  Controller  FilterDispatcher  Model  Action  View  Result  invoke action  render page  select result Struts 2 MVC is realized by three core framework components : actions, results, and the FilterDispatcher

Struts 2 Request processing Struts 2 request processing uses interceptors that fire before and after the action and result Action Result invoke result ActionContext (ThreadLocal) ValueStackrequestsession … OGNL invoke actionfinished interceptors OGNL

Declarative architecture [1] Declarative architecture Is a type of configuration that allows developers to describe their application architecture (configure) at a higher level than direct programmatic manipulation Configuration occurs at two levels in Struts  As the Struts framework is flexible, it allows the developer to tweak its behaviour in many areas. This activity is actually configuring the behaviour of the Struts framework  The more important type of configuration (or declarative architecture) refers to defining the Struts 2 components that are used by your application and wiring / linking them together to form your desired workflow paths  Workflow paths refer to which action fires when a particular URL is hit, and which results might be chosen by that action to complete processing.

Declarative architecture [2] Multiple methods There are two methods of declaring the architecture of the application being developed  Through XML based configuration files  Through java annotations Whether the declaration is in XML or using java annotations, the framework translates them both into the same run time components  With XML, one has the familiar XML configuration document with elements describing the application actions, results and interceptors.  struts.xml struts.xml  With java annotations, the XML is gone. The metadata is located as java annotations inside the java source code for the classes that implement the Struts 2 actions. An annotated source file is shown below.  HelloWorldAction.java HelloWorldAction.java

URL mapping to struts actions [helloworldxml project] + localhost: /helloworldxml + + /HelloWorld.action Protocol hostname:portnumber servlet context package name space action name.action The URL combines the servlet context with the package namespace and the action name. Note that the action name takes the.action extension. If the package name space is specified, that should be used as part of the struts action identifier URL, else it should be spaces.

Struts 2 data flow trace for the helloworldxml application Form rendered by index.jsp ValueStack HelloWorld Action String userName String message Form rendered by success.jsp

Struts 2 configuration Configuration files web.xml  Is a J2EE configuration file that determines how the elements of the HTTP request are processed by the servlet container. It is not a Struts 2 configuration file, but it is a file that needs to be configured for Struts to work struts.xml  Contains the configuration information that developer will be modifying as actions are developed. This is created under the directory WEB- INF/classes. struts-config.xml The struts-config.xml configuration file is a link between the View and Model components in the Web Client but you would not have to touch these settings for 99.99% of your projects. struts.properties This configuration file provides a mechanism to change the default behaviour of the framework. This file should be created in the WEB- INF/classes folder.Any line starting with # in this file is treated as comments.