Scripting JSF The best of both worlds Ed Burns Senior Staff Engineer Enterprise Java Platforms.

Slides:



Advertisements
Similar presentations
Lecture 11 Server Side Interaction
Advertisements

Apache Struts Technology
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
DT228/3 Web Development JSP: Directives and Scripting elements.
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
UNIT-V The MVC architecture and Struts Framework.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Enterprise Grade Ajax with JavaServer™ Faces Ed Burns Senior Staff Engineer Enterprise Java Platforms.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
JSP Java Server Pages Softsmith Infotech.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
Extending ArcGIS for Server
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
Fall CIS 764 Database Systems Design L8. Web ….
Peter Laird. | 1 Building Dynamic Google Gadgets in Java Peter Laird Managing Architect WebLogic Portal BEA Systems.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Ruby on Java Luc Castera
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
PHOBOS Javascript Engine By Daniel Reeves. What is Phobos? Lightweight application framework for Java Used by NetBeans Supports multiple scripting languages.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
3246 JSF Support in JBuilder 2005 Karl Ewald R&D Engineer Borland Software Corporation.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
® IBM Software Group © 2003 IBM Corporation IBM WebSphere Studio V5.1.2: Making Java Development Easier May 2004.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
Technologies For Creating Rich Internet Applications Presenter's name
Project Dynamic Faces World Class AJAX for JavaServer™ Faces Technology Ed Burns Senior Staff Engineer Enterprise Java Platforms.
GlassFish Workshop 1 Dynamic Languages in GlassFish Arun Gupta blogs.sun.com/arungupta.
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Comparative Display Technologies in Sakai.
A little more App Inventor and Mind the GAP!
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Google Web Toolkit Tutorial
Writing simple Java Web Services using Eclipse
Working with Client-Side Scripting
Introduction Enosis Learning.
Ruby, Rails, GUIs, and More
PHP / MySQL Introduction
Enterprise Java Bean. Overview of EJB View of EJB Conversation Roles in EJB, Types of Enterprise Beans Lifecycle of Beans Developing Applications using.
Dynamic Web Pages (Flash, JavaScript)
SVTRAININGS. SVTRAININGS Python Overview  Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed.
Introduction Enosis Learning.
MSIS 655 Advanced Business Applications Programming
Lesson Objectives Aims Key Words Compiler, interpreter, assembler
Java Server Pages (JSP)
JavaServer Faces: The Fundamentals
Intro to J2EE Concepts.
Presentation transcript:

Scripting JSF The best of both worlds Ed Burns Senior Staff Engineer Enterprise Java Platforms

2 Presentation Goals Share my opinion on scripting and server side applications Explain how scripting can benefit JSF developers Illustrate the power and flexibility of JSF

3 Agenda Historical Context > The Past is the Future? > Why Bother with Scripting? Let's Visit Phobos > Introducing Phobos > Combining JSF and Phobos JSF Extensibility

4 The Past is the Future? JavaScript > Thanks to Ajax, JavaScript is cool again > JavaScript support comes standard in JDK 6 > Scripting Java started in 1998 with Netscape LiveConnect. Virtual Machines > IBM System/370 from 1960 > Smalltalk-80 > Java VM: ubiquity (abundant) and price (free) are key JSR 223: Scripting for the Java Platform > Application level script interface > JavaScript, Ruby, Python bindings

5 Why Bother with Scripting? Benefits > Very malleable > Associative arrays really handy > Dynamically extend the language at runtime > Change design contracts with great fluidity Loose Typing Costs > performance: everything is interpreted every time it is needed > maintainability: lack of type system makes it impossible to concretely express design contracts JavaScriptClasses JavaScript Class Herder

6 Why Bother with Scripting? Benefits > Edit->Compile->Deploy->Debug->Repeat becomes Edit->Debug->Repeat > Akin to tuning an engine while it is running Costs > Can have a performance cost, but remember, Java itself is interpreted. > Also, many scripting languages can be sped up with compilation techniques No Deployment Step

7 Why Bother with Scripting? Benefits > Historically proven use of scripting: witness Perl > Works well on single host > Easy to get it done quickly Glue it all together Costs > Not so good with for assembling distributed apps > Easy to write obtuse code, and the contracts between system elements are not self evident to maintenance programmer.

8 Scripting Opinion Summary Scripting is here to stay Java is taking scripting seriously (no longer sacrilege to run non Java on the JVM JRuby on JVM will Rails apps natively > No I'm not afraid for the future of JSF

9 Scripting JavaServer Faces Lightweight Scripting Friendly Web Application environment Aimed at addressing emerging developer requirements Learns from Rails, but may prove to have different sweet spot than Rails: CRUD Let's visit Phobos

10 Scripting JavaServer Faces Let's visit Phobos

11 Lessons from Rails Directory layout for model, view, controller Naming conventions for mapping URL segments to scripts For example, given this layout controller/calculator.js view/calculator.ejs and an HTTP GET to means: In the calculator application, find the “calculator” script in the controller directory, and invoke its “show” method. This method is responsible for rendering the view, usually by calling a library function with a view name.

12 Lessons from Rails For example, given this layout controller/calculator.js view/calculator.ejs and an HTTP POST to means: In the calculator application, find the “calculator” script in the controller directory, and invoke its “compute” method. This method is responsible for accessing the model, performing the calculation, and re-rendering the view, usually by calling a library function with a view name.

13 Lessons from Rails Easily mix scripts and markup > Like JSP Scriptlets (remember those?) > Uses simple “Embedded JavaScript” syntax: Status

14 Lessons from Rails Easy convention for adding libraries to the core framework > Not nearly as nice as ruby gems, yet. Application lifecycle events > startup shutdown Plans for scaffolding

15 Differences from Rails Designed to work with any JSR223 compliant scripting language Extreme ease of calling into Java and back again var builder = new Packages.org.jdom.input.SAXBuilder(); Backed by full power of Java EE JavaScript basis means it is easy to use widget libraries like Dojo, Scriptaculous, (jMaki) etc.

16 Combining JSF and Phobos 1)In a Phobos application, with a Phobos controller, use JSF components naturally 2)In a Phobos application, with a Phobos controller, write any JSF artifact in a JSR 223 compliant scripting language a)Managed Beans b)Application Listeners (ValueChangeListener, ActionListener) c)Converter, Validator d)Renderer, UIComponent 3)In a JSF application, with JSF controller, allow any JSF artifact to be written using script: Start out with script, move to Java once design is solid Goals

17 Phobos Lifecycle Without JSF

18 Phobos Lifecycle Without JSF

19 Phobos POST Lifecycle With JSF

20 Redirect after POST and JSF “execute” portion of Lifecycle “render” portion of Lifecycle

21 Redirect after POST and JSF

22 Demonstrations

23 Implementation Details ViewHandler: PhobosViewHandler > called by library.jsf.renderAfterRedirect(), and library.jsf.postBeforeRedirect() > Calls back into script to execute proper “.ejs” file > This writes to a buffer, which is tweaked slightly to ensure state saving is properly handled, then handed off to the FaceletViewHandler. This builds and renders the JSF component tree, and handles state saving. JSF Extension Points used

24 Implementation Details ELResolver: FlashELResolver > called by library.jsf.renderAfterRedirect(), and library.jsf.postBeforeRedirect() > Is a Map whose entries expire based on the request/response lifecycle. > Concept from Ruby on Rails > Useful in JSF without Phobos as well > Great for “master/detail” > Allows JSF to handle “redirect after POST” JSF Extension Points used

25 Implementation Details Map implementation: JavaScriptJavaBeanMap > Allows writing JSF Managed Beans in JavaScript > Can use standard JSF faces-config.xml configuration syntax, but need not do so. > Change properties on the fly > Add new beans on the fly (not yet implemented) > If you put a Map in the scoped namespace, it immediately becomes available to the EL. JSF Extension Points used

26 Demonstrations

27 Summary Scripting is your friend It's the future, not the past Just because it's scripting, doesn't mean you can't use your old friends, quite the contrary! The extensible design of JSF makes it easy to integrate with Phobos Work is being done 100% in open source. CDDL License: please join! The Best of Both Worlds

28 Important Links Project Glassfish Project Phobos JSF-Extensions, JSF Flash Project jMaki

JSF + Phobos ● Ed Burns –