Michael Rimov Centerline Computers Craig McClanahan Sun Microsystems O’Reilly Open Source Convention July 7 - 11, 2003.

Slides:



Advertisements
Similar presentations
Apache Struts Technology
Advertisements

 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Web MVC-2: Apache Struts Rimon Mikhaiel
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.
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 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.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
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.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Java Beans.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
Introduction to MVC and the Jakarta Struts Framework By Gyanendra Dwivedi Software Consultant.
JavaServer Faces Jeff Schmitt October 5, Introduction to JSF Presents a standard framework for building presentation tiers for web applications.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
JSF road map (NI) Clientside validation Show problems
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
Jakarta Struts Presented by Object Computing, Inc. (OCI) Written by Greg Elliott
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
J2EE Structure & Definitions Catie Welsh CSE 432
® 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–
Stanisław Osiński, 2002JSP – A technology for serving dynamic web content Java Server Pages™ A technology for serving dynamic web content Stanisław Osiński,
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.
BOF # The Struts Framework Community The Struts Framework Community Craig McClanahan.
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.
J2EE Struts 1 3 Struts: Introduction 1 4 Once you’ve coded a lot of JSP applications, you find yourself doing a lot of repetitive things. Also,
CSC 2720 Building Web Applications Frameworks for Building Web Applications.
JavaServer Faces (JSF) and Ajax Integration. Agenda 대강의 ( 정말로..) 개요 예제 아키텍트라면..
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 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.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
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.
11 Copyright © 2004, Oracle. All rights reserved. Customizing Actions.
Implementation Struts Framework for well-architectured web applications Model-View-Controller design pattern.
JavaServer Faces framework Craig McClanahan is presented that created Struts web framework and based on experience gathered designed JavaServer.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
OOSD Using Java CBTS Framework. 11/2/04CBTS2 Servlet  A servlet is a Java program that can extends Web server’s functionality.  Servlets interact with.
By Jonathan Smith. Road Map Introduction Company Information Project Overview Java Web Design and Development Summary Relation to IUP Acknowledgments.
Apache Struts Technology A MVC Framework for Java Web Applications.
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 
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
The J2EE Framework Java Technologies External Application.
Unit 6-Chapter 2 Struts.
Introduction to Struts
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:

Michael Rimov Centerline Computers Craig McClanahan Sun Microsystems O’Reilly Open Source Convention July , 2003

Michael Rimov & Craig McClanahan Introduction Presentation Slides, Notes and Samples Available At:

Michael Rimov & Craig McClanahan What Defines Struts? Lightweight Model 2 J2EE framework for the HTTP Servlet portion of the application. NOT Meant to dictate the entire J2EE implementation.

Michael Rimov & Craig McClanahan Model 2 Typical Flow MVC Based Model 2 Architecture Diagram

Michael Rimov & Craig McClanahan Abbreviated Model

Michael Rimov & Craig McClanahan What Makes Struts So Extensible? Lightweight and Focused: Doesn’t Try To Do Everything. Well Designed: Very good separation of concerns, very clean coding implementation. Uses Java Reflection to allow freedom of objects.

Michael Rimov & Craig McClanahan Case Studies

Michael Rimov & Craig McClanahan Case Studies Struts and Expresso Struts and Macromedia Flash Struts and XML Struts and Java Server Faces

Michael Rimov & Craig McClanahan Case Study: Expresso /

Michael Rimov & Craig McClanahan Case Study: Expresso 5

Michael Rimov & Craig McClanahan Case Study: Expresso 5 Controller Extension: Provided Application Level Security Matrix Added in-request routing ability. Provided mostly-Servlet Independent flow of control.

Michael Rimov & Craig McClanahan Case Study: Expresso 5 Struts Action: public ActionForward perform( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) Expresso Version: protected void runPromptLoginState (ControllerRequest request, ControllerResponse response)

Michael Rimov & Craig McClanahan Case Study: Expresso 5 Model Extension: ControllerRequest / ControllerResponse objects. ControllerResponse is populated with Inputs/Outputs/Blocks/Transitions. Can use Struts Beans as well. Added Database Access Layer

Michael Rimov & Craig McClanahan Case Study: Expresso 5 View Extension: Default UI Renderer Customizable XSLT Processing Capabilities. Compatible with Struts Views.

Michael Rimov & Craig McClanahan Case Study: Expresso 5 Integration Experiences: Extremely supportive community Reaped Performance Improvements Partial Integrations still work well. Easy to extend even the Struts internals.

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash Integration Methods: XMLSocket and XML formatted pages. LoadVariables and property formatted pages. NOT covering Flash Remoting All Integration methods need some sort of template view system such as JSP or Velocity.

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash Start Page Tell Flash Where To Get Its Data.

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash XML Socket Method Create Flash Starting Page Load initial data through the ‘data’ parameter. On-submit, the movie opens an XML Socket to the server and Struts. Struts formats return data as XML.

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash XML Socket Method: Drawbacks XML Parsing on the Client Side. XML Parsing on the Server Side Expansion of Bandwidth

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash Load Variables Method Create Flash Starting Page Load initial data through the ‘data’ parameter. On-submit, the movie opens an http request to the server. Struts formats return data in a “property=value” format.

Michael Rimov & Craig McClanahan Case Study: Macromedia Flash Load Variables Method: Drawbacks Simple format of return data only. Fancier formats require parsing again. Similar drawbacks as XMLSocket. Recommended you use simple beans for rendering only Flash 6 Only

Michael Rimov & Craig McClanahan Quick ActionScript Sample on (release) { LoadVars lv = new LoadVars(); LoadVars receiveVars = new LoadVars(); lv.loginName=LoginName; lv.password = Password; receiveVars.onLoad = processResult; //Not Shown Here lv.sendAndLoad(data,receiveVars,"POST"); }

Michael Rimov & Craig McClanahan Introducing Craig McClanahan

Michael Rimov & Craig McClanahan Case Study: Struts and XML

Michael Rimov & Craig McClanahan Case Study: Struts and XML Most Struts apps generate HTML –With the Struts HTML tags (JSP) –With alternative presentation systems like Velocity and Freemarker Templates accessed via RequestDispatcher. forward() call, but there's another way... Action.execute() -- return null to indicate that the response has been created already Opens the door to XML-based output

Michael Rimov & Craig McClanahan Struts and XML: General Approach Form submitted to Action, as usual Action creates result beans, as usual, or renders XML objects Action renders XML directly (or forwards to an XML-generating template) Template incorporates dynamic data from result beans or rendered XML objects XSLT stylesheet(s) transform to HTML or other markup language

Michael Rimov & Craig McClanahan Struts and XML: Resources JSP and JSTL can be used directly instead of HTML tags Two Popular Struts and XML Extensions: –StrutsCX –Stxx More information online, on the Struts Resources pages:

Michael Rimov & Craig McClanahan Case Study: Struts and JavaServer Faces

Michael Rimov & Craig McClanahan Case Study: JavaServer Faces What Is JavaServer Faces? –Server-side user interface component framework for Java-based web apps –Under development in the Java Community Process (JSR-127) –Currently at Public Draft 2 in the process –Early Access 4 of Reference Implementation is available –

Michael Rimov & Craig McClanahan JavaServer Faces: Goals Accessible to corporate developers Usable via tools and by hand Usable with and without JSP Usable with and without HTML Usable with servlet and portlet APIs Can be adopted immediately –Minimum platform: Servlet 2.3, JSP 1.2 –Final 1.0 version: 4QCY2003

Michael Rimov & Craig McClanahan JavaServer Faces: Features Extensible UI component model Flexible rendering model –Standard HTML renderkit included Event and listener model Validation framework Basic page navigation support Internationalization and accessibility

Michael Rimov & Craig McClanahan JavaServer Faces: Sample Page <h:input_text id=”username” length=”16” valueRef=”logonBean.username”/> <h:input_secret id=”password” length=”16” valueRef=”logonBean.password”/>

Michael Rimov & Craig McClanahan JavaServer Faces: Sample Page <h:command_button type=”submit” label=”Log On” actionRef=”logonBean.logon”/> <h:command_button type=”reset” label=”Reset”/>

Michael Rimov & Craig McClanahan JavaServer Faces: Managed Bean logonBean mypackage.mybeans.LogonBean request

Michael Rimov & Craig McClanahan JavaServer Faces: Bean Class public class LogonBean { // No base class! // The usual property getters/setters public String getUsername() {... } public void setUsername(String username) {... } public String getPassword() {... } public void setPassword(String password) {... }

Michael Rimov & Craig McClanahan JavaServer Faces: Bean Class... // Getter returns “Action” for button public Action getLogon() { // Anonymous inner class used here return new Action() { public String invoke() { // Invoke method on bean class return (logon()); } }; }

Michael Rimov & Craig McClanahan JavaServer Faces: Bean Class... protected String logon() { // Business logic can access form fields // as instance variables if (username/password combo is ok) { return (“success”); // Logical outcome } else { return (null); }

Michael Rimov & Craig McClanahan JavaServer Faces: Navigation // Wildcard and global patterns ok /logon.jsp // Optional logonBean.logon // Optional success /mainmenu.jsp

Michael Rimov & Craig McClanahan JavaServer Faces and Struts So, is JavaServer Faces Replacing Struts? –NO!!! –Struts 1.1 is and remains very popular –Struts will continue to innovate & advance Then, can I use them together? –YES!!! –With the Struts-Faces Integration Library struts/ release/struts-faces/

Michael Rimov & Craig McClanahan JavaServer Faces And Struts Replaces Struts HTML Tags With More Powerful JavaServer Faces Components Continue to use struts-config.xml file Integrates with Struts RequestProcessor Supports Standard Struts Features: –Form Beans and Actions –Validator Framework –Tiles Framework (coming soon...)

Michael Rimov & Craig McClanahan JavaServer Faces and Struts To use the library with an existing app: –Get the JavaServer Faces RI –Drop it and struts-faces.jar into your /WEB- INF/lib directory –Change HTML tags on one page at a time –Tweak your forward paths, and –Don't touch your form beans or actions MVC works... what a concept :-).

Michael Rimov & Craig McClanahan Conclusion

Michael Rimov & Craig McClanahan Presentation Information Michael Rimov: Craig McClanahan: Slides, Notes and Sample Code Available

Michael Rimov & Craig McClanahan