March 28, 2001XSP Session O’Reilly Enterprise Java Conference 1 XSP Session Sue Spielman President/Consulting Engineer President/Consulting Engineer www.switchbacksoftware.com.

Slides:



Advertisements
Similar presentations
Inside an XSLT Processor Michael Kay, ICL 19 May 2000.
Advertisements

8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
Apache Struts Technology
XSLT (eXtensible Stylesheet Language Transformation) 1.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
DT211/3 Internet Application Development
DT228/3 Web Development JSP: Directives and Scripting elements.
Java Server Pages B.Ramamurthy. Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content.
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Comp2513 Java Server Pages Daniel L. Silver, Ph.D.
1 CS6320 – JSP L. Grewe 2 Java Server Pages Servlets require you to write out entire page delivered with print statements Servlets require you to write.
Three types of scripting elements: 1.Expressions 2.Scriptlets 3.Declarations Scripting elements.
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
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.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 9 JavaServer Pages (JSP) (Based on Møller.
1 Understanding Cocoon2 Pankaj Kumar May 24, 2001 Web Services Organization HPMD, SSO, HP.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
CPS120: Introduction to Computer Science The World Wide Web Nell Dale John Lewis.
SDPL 2002Notes 7: Apache Cocoon1 7 XML Web Site Architecture Example: Apache Cocoon, a Web publishing architecture based on XML technology
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
Introduction to Java Server Pages (JSPs) Robert Thornton.
Chapter 7 Java Server Pages. Objectives Explain how the separation of concerns principle applies to JSP Describe the operation and life-cycle of a JSP.
Introduction to JavaServer Pages (JSP) Slides from Dr. Mark Llewellyn.
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.
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,
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Lecture 11 XSL Transformations (part 1: Introduction)
Web Server Programming 3. Server side includes. HTML+ (‘hole’) technologies Uses ‘HTML+”, HTML (or XML) extended with code. Very many different varieties.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
SDPL 2001Notes 7.2: Apache Cocoon1 7.2 Apache Cocoon An example of a Web publishing architecture based on XML technology An.
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
CSC 2720 Building Web Applications JavaServer Pages (JSP) The Basics.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Jennifer Widom XML Data Introduction, Well-formed XML.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Martin Kruliš by Martin Kruliš (v1.1)1.
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
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.
JAVA SERVER PAGES -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
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.
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.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Apache Struts Technology A MVC Framework for Java Web Applications.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Unit 4 Representing Web Data: XML
XML in Web Technologies
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
More Sample XML By Sadia Anjum.
XML Problems and Solutions
Struts BY: Tejashri Udavant..
Unit 6 - XML Transformations
Presentation transcript:

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 1 XSP Session Sue Spielman President/Consulting Engineer President/Consulting Engineer

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 2 Session Overview XSP OverviewXSP Overview XSP vs. JSPXSP vs. JSP Technologies InvolvedTechnologies Involved Object ModelObject Model Implementation DetailsImplementation Details SamplesSamples QuestionsQuestions

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 3 XSP – What Is It? eXtensible Server PageseXtensible Server Pages Component of Cocoon used for building web apps with dynamic XML contentComponent of Cocoon used for building web apps with dynamic XML content Dynamic content is based onDynamic content is based on –Request Parameters –Databases –Remote Server Processes

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 4 XSP – Purpose Created to allow web authors to generate dynamic content without forcing them to learn a programming languageCreated to allow web authors to generate dynamic content without forcing them to learn a programming language Promotes a clean division of labor:Promotes a clean division of labor: –Application Developers –Content authors –Presentation designers

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 5 XSP vs. JSP Similarities Follows the compiled server pages modelFollows the compiled server pages model Can be parsed and validated by regular XML parsersCan be parsed and validated by regular XML parsers Can be transformed by XSLT processorsCan be transformed by XSLT processors Aim to programming language abstractionAim to programming language abstraction

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 6 XSP vs. JSP Differences Output ExposureOutput Exposure –XSP doesn’t have access to the output stream –JSP has access to output stream Page ReadabilityPage Readability –XSP uses the XML features to allows code to be easily distinguishable between markup elements –JSP needs to enclose programming code by scriptlet tags

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 7 X* Technologies Involved XSP – eXtensible Server PagesXSP – eXtensible Server Pages XML – eXtensible Markup LanguageXML – eXtensible Markup Language –Portable Data XSL - Stylesheet language for XMLXSL - Stylesheet language for XML –Includes an XML vocabulary for specifying formatting XSLT – XSL TransformationsXSLT – XSL Transformations –Language for transforming XML documents into other XML documents.

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 8 Object Model Processors – take a DOM tree as input and produce another DOM tree as output (i.e. XSP engine in Cocoon)Processors – take a DOM tree as input and produce another DOM tree as output (i.e. XSP engine in Cocoon) Producers – what XSP pages are compiled into (Cocoon Java type).Producers – what XSP pages are compiled into (Cocoon Java type). –Similar to the fact that JSPs are compiled into Servlets

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 9 Object Model Model from xml.apache.org

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 10 Built-in Objects requestsession responseservletContext documentxspGlobal xspNodeStack xspCurrentNod e xspParentNodexspParser Should look familiar to JSP programmers…

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 11 XSPUtil Class DOM utility methodsDOM utility methods –cloneNode, toMarkup HTTPHTTP –encodeMarkup, formEncode, formDecode FileFile –pathComponent, fileComponent, baseName, normalizeBaseName, relativeFileName StringString –split, isAlphaNumeric

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 12 What is an XSP Page An XSP page is an XML page with the following requirements:An XSP page is an XML page with the following requirements: –A Cocoon processing instruction that invokes the XSP processor –A Cocoon processing instruction that invokes the XSP processor –Document root element must be –Document root element must be –Any language and Taglib declarations as attributes in the tag. Example: –Any language and Taglib declarations as attributes in the tag. Example: –An element and an element.

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 13 Sample Minimal XSP <xsp:logic> static private int counter = 0; static private int counter = 0; private synchronized int count() { private synchronized int count() { return counter++; return counter++; } <page> This page has been requested count() times. This page has been requested count() times.

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 14 Processing Instruction XML PIs used to forward the document to the right processor or formatter.XML PIs used to forward the document to the right processor or formatter. for processing for processing for formatting for formatting Examples:Examples: – –

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 15 Logic Tags encloses developer- supplied program logic. Transcribed verbatim into the generated Cocoon producer encloses developer- supplied program logic. Transcribed verbatim into the generated Cocoon producer evaluates a program expression and substitutes its value as a Text DOM node in the resulting document evaluates a program expression and substitutes its value as a Text DOM node in the resulting document

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 16Tagset<xsp:page><xsp:structure> <xsp:include><xsp:content> <xsp:logic><xsp:expr> <xsp:element><xsp:attribute> <xsp:pi>

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 17 Scripting Languages XSP designed to support scripting languages other than JavaXSP designed to support scripting languages other than Java In theory, any programming language that has a Java-based interpreter could be used to script XSPIn theory, any programming language that has a Java-based interpreter could be used to script XSP Right now, only JavaRight now, only Java

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 18 Sample - Embedded Logic sample.xml Well formed XSP page XSP Stylesheet sample.xsl HTML sample.html

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 19 Sample - Included Logicsheet HTML sample.html LogicSheet sample-xsp.xsl sample.xml Stylesheet sample.xsl XSP Transformed XML

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 20 Sample - Taglib Logicsheet HTML sample.html LogicSheet taglib.xsl sample.xml Stylesheet sample.xsl XSP Transformed XML XSP That Includes A Reference To A Taglib Properties File Cocoon properties

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 21 Additional Resources xml.apache.orgxml.apache.org xml.apache.org/cocoon/wd-xsp.htmlxml.apache.org/cocoon/wd-xsp.html

March 28, 2001XSP Session O’Reilly Enterprise Java Conference 22Questions<xsp:logic> ? ? ? </xsp:logic><xsp:logic> </xsp:logic>