Java Web Development

Total Page:16

File Type:pdf, Size:1020Kb

Java Web Development ARTOF JAVA WEB DEVELOPMENT STRUTS TAPESTRY COMMONS VELOCITY Neal Ford JUNIT AXIS COCOON INTERNETBEANS WEBWORK MANNING Art of Java Web Development Art of Java Web Development STRUTS, TAPESTRY, COMMONS, VELOCITY, JUNIT, AXIS, COCOON, INTERNETBEANS, WEBWORK NEAL FORD MANNING Greenwich (74° w. long.) For online information and ordering of this and other Manning books, go to www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 209 Bruce Park Avenue Fax: (203) 661-9018 Greenwich, CT 06830 email: [email protected] ©2004 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books they publish printed on acid-free paper, and we exert our best efforts to that end. Manning Publications Co. Copyeditor: Liz Welch 209 Bruce Park Avenue Typesetter: Dottie Marsico Greenwich, CT 06830 Cover designer: Leslie Haimes ISBN: 1-932394-06-0 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – VHG – 08 07 06 05 04 03 To Chuck, who still teaches me stuff daily brief contents PART ITHE EVOLUTION OF WEB ARCHITECTURE AND DESIGN....................................................... 1 1 I State-of-the-art web design 3 2 I Building web applications 27 3 I Creating custom JSP tags 61 4 I The Model 2 design pattern 91 PART II WEB FRAMEWORKS ........................................ 131 5 I Using Struts 133 6 I Tapestry 159 7 I WebWork 199 8 I InternetBeans Express 227 9 I Velocity 261 10 I Cocoon 283 11 I Evaluating frameworks 311 vii viii BRIEF CONTENTS PART III BEST PRACTICES............................................ 327 12 I Separating concerns 329 13 I Handling flow 371 14 I Performance 409 15 I Resource management 445 16 I Debugging 475 17 I Unit testing 521 18 I Web services and Axis 543 19 I What won’t fit in this book 563 contents preface xvii acknowledgments xix about the book xxi about the cover illustration xxx PART ITHE EVOLUTION OF WEB ARCHITECTURE AND DESIGN....................................................... 1 State-of-the-art web design 3 1 1.1 A brief history of Java web development 4 1.2 The importance of design patterns 6 The Model-View-Controller design pattern 7 I The emergence of Model 2 9 I Evolution 10 1.3 Using frameworks 11 A flavor of the Struts framework 12 I A flavor of the Turbine framework 14 I Objectively choosing a framework 20 1.4 Best practices 20 Business rules 20 I Where should the rules reside? 22 Leveraging best practices 24 1.5 Summary 25 ix x CONTENTS Building web applications 27 2 2.1 Building web applications with servlets 29 The eMotherEarth servlet application 29 Evaluating the servlet approach 50 2.2 Building web applications with JSP 50 The JSP eMotherEarth application 51 Evaluating the JSP approach 59 2.3 Summary 60 Creating custom JSP tags 61 3 3.1 The case for custom tags 62 3.2 The tag interfaces 63 The Tag interface 63 I The IterationTag interface 64 The BodyTag interface 65 3.3 Building simple tags 66 The HtmlSqlResult tag 66 I Registering the tag 71 3.4 Validating tag attributes 75 Adding DbPool to the application tag 75 3.5 Using prebuilt tags 80 Using JSTL 81 I Using other taglibs 84 3.6 Custom tag considerations 86 Resource usage 87 I Building a framework 88 3.7 Now that we’re here, where are we? 88 3.8 Summary 89 The Model 2 design pattern 91 4 4.1 Using Model 2 as your framework 92 The Model 2 schedule application 93 Options in Model 2 116 4.2 Parameterizing commands with controller servlets 117 An example of parameterizing commands 118 Advantages and disadvantages 127 4.3 Summary 128 CONTENTS xi PART II WEB FRAMEWORKS ........................................ 131 Using Struts 133 5 5.1 Building Model 2 Web applications with Struts 134 The Struts schedule application 134 I Value objects as form beans 136 I Objectifying commands with Struts’ actions 137 Configuring Struts applications 139 I Using Struts’ custom tags to simplify JSP 142 I Internationalization with Struts 145 Struts’ support for data entry 147 I Declarative validations 151 5.2 Evaluating Struts 156 5.3 Summary 157 Tapestry 159 6 6.1 Overview 160 6.2 The architecture 160 6.3 A simple Tapestry application 162 Tapestry Hello, World 162 6.4 The Tapestry framework 167 Framework classes and interfaces 167 I Components 170 6.5 Scheduling in Tapestry 173 Bootstrapping the application 173 I The Home page 176 The custom table component 180 I The Add page 185 6.6 Evaluating Tapestry 192 Documentation and samples 192 I Debugging support 195 Using Tapestry 196 6.7 Summary 197 WebWork 199 7 7.1 Overview 200 The architecture 201 I The configuration 202 7.2 Key concepts 203 Actions 204 I Key interfaces 204 I The value stack 205 Expression language 206 I BeanInfo classes 207 Templates 207 xii CONTENTS 7.3 Scheduling in WebWork 208 The configuration 208 I The View page 209 The Add page 214 I Validations 220 7.4 Evaluating WebWork 224 7.5 Summary 226 InternetBeans Express 227 8 8.1 Overview 228 8.2 The architecture 230 DataExpress 230 I InternetBeans Express 233 8.3 InternetBeans Express components 234 ixPageProducer 234 I ixComponents 236 8.4 Scheduling with InternetBeans 237 Data connectivity 238 I The View page 242 I The Add page 245 I Validations 249 8.5 JSP custom tags 255 8.6 Evaluating InternetBeans Express 257 Documentation and samples 257 Using InternetBeans Express 258 8.7 Summary 259 Velocity 261 9 9.1 Overview 262 9.2 The architecture 263 9.3 Key concepts 265 Setting up Velocity 265 I The Velocity Template Language 268 I Context 269 9.4 Scheduling with Velocity 269 The View page 271 I The Add page 274 Validations 278 CONTENTS xiii 9.5 Evaluating Velocity 281 Documentation and samples 281 I Using Velocity 282 9.6 Summary 282 Cocoon 283 10 10.1 Overview 284 10.2 The architecture 285 The publishing framework 285 I The web framework 288 10.3 Key concepts 289 The publishing framework 289 I The sitemap 295 The web framework 299 10.4 Scheduling in Cocoon 302 The sitemap 303 I The action 304 I The view 305 10.5 Evaluating Cocoon 307 Documentation and samples 307 I Source code 308 Debugging 308 10.6 Summary 309 Evaluating frameworks 311 11 11.1 Evaluation criteria 312 Suitability to the application 312 I Documentation 315 Source code 316 I Tool support 317 I External criteria 318 11.2 Design considerations 319 Adherence to good design principles 319 I The user interface 320 I Innovative features 321 Insularity 322 I “Feel” 322 11.3 What I like 323 Transparent infrastructure 323 I Innovative ideas 323 Ultra-high cohesion and low coupling 324 Evaluating frameworks as a hobby 324 11.4 Summary 324 xiv CONTENTS PART III BEST PRACTICES............................................ 327 Separating concerns 329 12 12.1 Using interfaces to hide implementation 330 JDBC interfaces 331 I Interfaces in frameworks 331 Decoupled classes 332 12.2 Using JavaBeans 333 Model beans 334 12.3 Using Enterprise JavaBeans 337 The EJB architecture 338 I Porting from JavaBeans to Enterprise JavaBeans 340 I Using EJBs in web frameworks 360 Managing JNDI context 361 12.4 Performing validations with model beans 362 Client-side validations 362 Building client-side validations from the server 365 12.5 Summary 368 Handling flow 371 13 13.1 Application usability options 372 Building the base: eMotherEarth.com 372 I Page-at-a-time scrolling 378 I Sortable columns 384 User interface techniques in frameworks 389 13.2 Building undo operations 390 Leveraging transaction processing 391 I Using the Memento design pattern 394 I Undo in frameworks 401 13.3 Using exception handling 401 The difference between technical and domain exceptions 401 Creating custom exception classes 402 I Where to catch and handle exceptions 403 I Exceptions in frameworks 406 13.4 Summary 407 Performance 409 14 14.1 Profiling 410 Measuring memory 410 I Performance profiling 412 Load testing 419 I Performance of profiling frameworks 421 CONTENTS xv 14.2 Common performance pitfalls 421 Object creation 422 I Extraneous object references 424 String usage 426 14.3 Pooling 427 Simple object pools 427 I Soft and weak references 428 Commons pools 433 I Pooling in frameworks 440 14.4 Designing for scalability 440 When to scale up to EJB 441 Molding your architecture for the future 441 14.5 When to optimize 442 14.6 Summary 443 Resource management 445 15 15.1 Caching strategies 446 Caching with the Flyweight design pattern 447 I Caching with the Façade design pattern 453 I Resource management in frameworks 469 15.2 Other resources you need to manage 470 Effectively using JNDI 470 I Using lazy instantiation 472 Working with web collections 472 15.3 Summary 473 Debugging 475 16 16.1 Debugging web applications 476 16.2 Debugging with the SDK 483 Starting the debugger 483 I Running the debugger 486 Breakpoints and steps 489 I Accessing variables 490 Effectively using jdb 492 16.3 Debugging with IDEs 493 Debugging with NetBeans 493 I Debugging with JBuilder 498 Differences between debuggers 502 16.4 Evaluating
Recommended publications
  • Web Application Firewall Security Advisory
    Web Application Firewall Web Application Firewall Security Advisory Product Documentation ©2013-2019 Tencent Cloud. All rights reserved. Page 1 of 20 Web Application Firewall Copyright Notice ©2013-2019 Tencent Cloud. All rights reserved. Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distribute in any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent. Trademark Notice All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud Computing (Beijing) Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned by their respective proprietors. Service Statement This document is intended to provide users with general information about Tencent Cloud's products and services only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are subject to change. Specific products and services and the standards applicable to them are exclusively provided for in Tencent Cloud's applicable terms and conditions. ©2013-2019 Tencent Cloud. All rights reserved. Page 2 of 20 Web Application Firewall Contents Security Advisory Command Execution Vulnerability in Exchange Server SQL Injection Vulnerability in Yonyou GRP-U8 XXE Vulnerability in Apache Cocoon (CVE-2020-11991) Arbitrary Code Execution Vulnerability in WordPress File Manager Jenkins Security Advisory for September Remote Code Execution Vulnerabilities in Apache Struts 2 (CVE-2019-0230 and CVE-2019- 0233) SQL Injection Vulnerability in Apache SkyWalking (CVE-2020-13921) ©2013-2019 Tencent Cloud. All rights reserved. Page 3 of 20 Web Application Firewall Security Advisory Command Execution Vulnerability in Exchange Server Last updated:2020-12-15 15:20:26 On September 17, 2020, Tencent Security detected that Microsoft issued a security advisory for a command execution vulnerability in Exchange Server (CVE-2020-16875).
    [Show full text]
  • Návrhy Internetových Aplikací
    Bankovní institut vysoká škola Praha Katedra informačních technologií a elektronického obchodování Návrhy internetových aplikací Bakalářská práce Autor: Jiří Nachtigall Informační technologie, MPIS Vedoucí práce: Ing. Jiří Rotschedl Praha Srpen, 2010 Prohlášení Prohlašuji, že jsem bakalářskou práci zpracoval samostatně a s použitím uvedené literatury. V Praze, dne 24. srpna 2010 Jiří Nachtigall Poděkování Na tomto místě bych rád poděkoval vedoucímu práce Ing. Jiřímu Rotschedlovi za vedení a cenné rady při přípravě této práce. Dále bych chtěl poděkovat Ing. Josefu Holému ze společnosti Sun Microsystems za odbornou konzultaci. Anotace Tato práce se zaměřuje na oblast návrhu internetových aplikací. Podrobně popisuje celý proces návrhu počínaje analýzou za použití k tomu určených nástrojů jako je use case a user story. Další částí procesu je návrh technologického řešení, které se skládá z výběru serverového řešení, programovacích technik a databází. Jako poslední je zmíněn návrh uživatelského rozhraní pomocí drátěných modelů a návrh samotného designu internetové aplikace. Annotation This work focuses on web application design. It describes whole process of design in detail. It starts with analysis using some tools especially created for this purpose like use case and user story. Next part of the process is technical design which consists from selection of server solution, programming language and database. And finally user interface prepared using wireframes is mentioned here alongside with graphical design of the web application. Obsah Úvod
    [Show full text]
  • Opensource Webframeworks(Cocoon,Struts
    Webframeworks - Teil 2 Cocoon, Jetspeed, Struts und Co. AUTOR Thomas Bayer ) Schulung ) Orientation in Objects GmbH Veröffentlicht am: 1.4.2003 ABSTRACT Nachdem die Frage geklärt wurde, wann ein Framework eingesetzt werden soll, hilft ) Beratung ) Ihnen der zweite Teil bei der Auswahl eines passenden Frameworks. Bei den im Folgenden beschriebenen Frameworks handelt es sich ausschließlich um Open Source Frameworks. Eine kommerzielle Verwendung ist in den meisten Fällen durch die Apache oder LGPL Lizenz möglich. Diese Frameworks sind nicht nur aus Kostengründen immer häufiger in kommerziellen Projekten zu finden. Ein Framework muss leben, es genügt nicht, dass ein Hersteller von Zeit zu Zeit Updates anbietet. Wichtig für die Entscheidung für ein Framework ist die Gemeinschaft der ) Entwicklung ) Entwickler, die das Framework entwickeln und verwenden. Offene Frameworks besitzen meist eine größere Entwicklergemeinde als hochpreisige Produkte. Für diesen Artikel wurden die Frameworks kategorisiert und Überschriften zugeordnet. Die einzelnen Kategorien wie MVC oder Templating Framework gehen teilweise ) ineinander über und sind schwer zu trennen. Besonders das "Schlagwort" MVC beansprucht fast jedes Framework für sich. Artikel ) Trivadis Germany GmbH Weinheimer Str. 68 D-68309 Mannheim Tel. +49 (0) 6 21 - 7 18 39 - 0 Fax +49 (0) 6 21 - 7 18 39 - 50 [email protected] Java, XML, UML, XSLT, Open Source, JBoss, SOAP, CVS, Spring, JSF, Eclipse 5 MVC FRAMEWORKS Die folgenden Jakarta Projekte stehen in enger Beziehung zu Turbine: • Service Framework Fulcrum Fast alle der hier aufgeführten Frameworks behaupten, die Model • Das verteilte Java Caching System JCS View Controller Architektur zu unterstützen. Ein typischer Vertreter, der sich stark auf MVC fürs Web konzentriert, ist Struts.
    [Show full text]
  • The Jakarta Struts Cookbook Is an Amazing Collection of Code
    Jakarta Struts Cookbook By Bill Siggelkow Publisher: O'Reilly Pub Date: February 2005 ISBN: 0-596-00771-X Pages: 526 Table of • Contents • Index • Reviews • Examples The Jakarta Struts Cookbook is an amazing collection of code solutions to Reader common--and uncommon--problems encountered when building web • Reviews applications with the Struts Framework. With solutions to real-world • Errata problems just a few page flips away, this quick, look-up reference is • Academic perfect for independent developers, large development teams, and everyone in between who wishes to use the Struts Framework to its fullest potential. Jakarta Struts Cookbook By Bill Siggelkow Publisher: O'Reilly Pub Date: February 2005 ISBN: 0-596-00771-X Pages: 526 Table of • Contents • Index • Reviews • Examples Reader • Reviews • Errata • Academic Copyright Preface Audience Scope and Organization Assumptions This Book Makes Conventions Used in This Book Using Code Examples Comments and Questions Safari Enabled Acknowledgments Chapter 1. Getting Started: Enabling Struts Development Introduction Recipe 1.1. Downloading Struts Recipe 1.2. Deploying the Struts Example Application Recipe 1.3. Migrating from Struts 1.0 to Struts 1.1 Recipe 1.4. Upgrading from Struts 1.1 to Struts 1.2 Recipe 1.5. Converting JSP Applications to Struts Recipe 1.6. Managing Struts Configuration Files Recipe 1.7. Using Ant to Build and Deploy Recipe 1.8. Generating Struts Configuration Files Using XDoclet Chapter 2. Configuring Struts Applications Introduction Recipe 2.1. Using Plug-ins for Application Initialization Recipe 2.2. Eliminating Tag Library Declarations Recipe 2.3. Using Constants on JSPs Recipe 2.4. Using Multiple Struts Configuration Files Recipe 2.5.
    [Show full text]
  • Apache Cocoon 2
    Apache Cocoon 2 Motivación, Introducción y Explicación Saúl Zárrate Cárdenas Apache Cocoon 2: Motivación, Introducción y Explicación por Saúl Zárrate Cárdenas Este documento se cede al dominio público. Historial de revisiones Revisión 0.0 6 de Mayo de 2002 Revisado por: szc Creación Historial de revisiones Revisión 0.1 5 de Junio de 2002 Revisado por: jidl Correcciones de ortografía y marcado Historial de revisiones Revisión 0.2 17 de Julio de 2002 Revisado por: szc Adición de formato de reunión semanal como apéndice y organización de directorios para las imagenes y los fuentes Historial de revisiones Revisión 0.3 31 de agosto de 2002 Revisado por: fjfs Cambio de formato de imágenes a png y correcciones ortográficas Revisión 1.0 18 de Octubre de 2002 Revisado por: jid Conversión a xml, correccion de errores menores de marcado Tabla de contenidos 1. ¿Por qué Cocoon? ..................................................................................................................................1 1.1. Motivación ..................................................................................................................................1 1.2. Entornos de publicación web (Web Publishing Framework) ......................................................2 2. Cocoon ....................................................................................................................................................3 2.1. ¿Qué es Cocoon?.........................................................................................................................3
    [Show full text]
  • Reflexión Académica En Diseño & Comunicación
    ISSN 1668-1673 XXXII • 2017 Año XVIII. Vol 32. Noviembre 2017. Buenos Aires. Argentina Reflexión Académica en Diseño & Comunicación IV Congreso de Creatividad, Diseño y Comunicación para Profesores y Autoridades de Nivel Medio. `Interfaces Palermo´ Reflexión Académica en Diseño y Comunicación Comité Editorial Universidad de Palermo. Lucia Acar. Universidade Estácio de Sá. Brasil. Facultad de Diseño y Comunicación. Gonzalo Javier Alarcón Vital. Universidad Autónoma Metropolitana. México. Centro de Estudios en Diseño y Comunicación. Mercedes Alfonsín. Universidad de Buenos Aires. Argentina. Mario Bravo 1050. Fernando Alberto Alvarez Romero. Pontificia Universidad Católica del C1175ABT. Ciudad Autónoma de Buenos Aires, Argentina. Ecuador. Ecuador. www.palermo.edu Gonzalo Aranda Toro. Universidad Santo Tomás. Chile. [email protected] Christian Atance. Universidad de Lomas de Zamora. Argentina. Mónica Balabani. Universidad de Palermo. Argentina. Director Alberto Beckers Argomedo. Universidad Santo Tomás. Chile. Oscar Echevarría Renato Antonio Bertao. Universidade Positivo. Brasil. Allan Castelnuovo. Market Research Society. Reino Unido. Coordinadora de la Publicación Jorge Manuel Castro Falero. Universidad de la Empresa. Uruguay. Diana Divasto Raúl Castro Zuñeda. Universidad de Palermo. Argentina. Michael Dinwiddie. New York University. USA. Mario Rubén Dorochesi Fernandois. Universidad Técnica Federico Santa María. Chile. Adriana Inés Echeverria. Universidad de la Cuenca del Plata. Argentina. Universidad de Palermo Jimena Mariana García Ascolani. Universidad Comunera. Paraguay. Rector Marcelo Ghio. Instituto San Ignacio. Perú. Ricardo Popovsky Clara Lucia Grisales Montoya. Academia Superior de Artes. Colombia. Haenz Gutiérrez Quintana. Universidad Federal de Santa Catarina. Brasil. Facultad de Diseño y Comunicación José Korn Bruzzone. Universidad Tecnológica de Chile. Chile. Decano Zulema Marzorati. Universidad de Buenos Aires. Argentina. Oscar Echevarría Denisse Morales.
    [Show full text]
  • Apachecon 2004 November 13-17, 2004 Las Vegas Nevada
    ApacheCon 2004 November 13-17, 2004 Las Vegas Nevada CLICK SESSION TITLE FOR PRESENTATION TUTORIALS MONDAY TUESDAY WEDNESDAY T01 Introduction to the Apache Web Server T02 mod_perl 2.0 by Example T03 Apache Portable Runtime 1.0 Tutorial T06 Mangling data with XSLT T07 Test-Driven Apache Module Development T08 Tapestry In Action T09 SpamAssassin Tutorial T10 Everything You Always Wanted to Know About XML Parsing T11 Scalable Internet Architectures T12 Apache Derby/Cloudscape: Embed This! T13 Struts: the good, the bad, and the ugly T14 Subversion Tutorial T15 Digging deep into XML Schema with Apache XMLBeans T16 PHP Security T17 Taming Apache Cocoon T18 Lucene in Action Search Next Help ApacheCon 2004 November 13-17, 2004 Las Vegas Nevada CLICK SESSION TITLE FOR PRESENTATION TUTORIALS MONDAY TUESDAY WEDNESDAY MO01 Behind the Scenes of the Apache Software Foundation MO02 Apache 2.0 on Windows MO03 The State of Apache Geronimo MO04 Advanced Topics in Module Design: Threadsafety and Portability MO05 The Incubator: Starting a Successful Apache Open Source Project MO06 Apache authentication MO07 Comparing Web Frameworks: Struts, Spring MVC, WebWork, Tapestry & JSF MO08 WebDAV and Apache MO09 New and upcoming features in SpamAssassin v3 MO10 What's so great about Apache 2.0? MO11 Embedding Tomcat 5 into Applications Servers MO12 Logging and Configuration - Demystifying the banes of App development MO13 Storing SpamAssassin User Data in SQL Databases MO14 Shoehorning Apache Onto Your Box: System Sizing Tips MO15 Highly available web sites with Tomcat
    [Show full text]
  • Working with XSP in Apache Cocoon 2
    Working with XSP in Apache Cocoon 2 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Tutorial introduction.................................................... 2 2. XSP concepts........................................................... 6 3. XSP syntax .............................................................. 11 4. Logicsheets ............................................................. 22 5. Creating logicsheets ................................................... 27 6. Summary and resources .............................................. 31 Working with XSP in Apache Cocoon 2 Page 1 of 32 ibm.com/developerWorks Presented by developerWorks, your source for great tutorials Section 1. Tutorial introduction Who should take this tutorial? This tutorial is the second in a series of tutorials on Apache Cocoon 2. It introduces XML Server Pages (XSP), the Cocoon technology for generating dynamic XML content. It is designed to build on the concepts described in the first tutorial, Introducing Cocoon 2; it is therefore recommended that you complete the previous tutorial before progressing further. This tutorial is based on Cocoon 2. While XSP was present in Cocoon 1, architectural differences mean that the majority of the examples are not applicable to that version. It is assumed that you are familiar with Java Web development frameworks such as Java Servlets and Java Server Pages (JSP). Where appropriate, parallels are drawn between concepts in these technologies and XSP. This tutorial will be of interest primarily to developers who have progressed beyond the basic features of Cocoon 2 and want to learn how to add dynamic data to their XML documents to create richer Web sites. The tutorial is also relevant for developers who need to integrate Cocoon 2 with existing data sources and/or APIs to publish their data in multiple formats over the Internet.
    [Show full text]
  • Using Cocoon, WML, and Xmlforms
    Using Cocoon, WML, and XMLForms Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Before you start......................................................... 2 2. Getting started with Cocoon.......................................... 3 3. Cocoon processing model, sitemap, and pipelines............... 4 4. Cocoon and HTML ..................................................... 7 5. Cocoon and WML ...................................................... 11 6. Cocoon, XMLForms, and WML ...................................... 14 7. Summary and resources .............................................. 19 Using Cocoon, WML, and XMLForms Page 1 of 19 ibm.com/developerWorks Presented by developerWorks, your source for great tutorials Section 1. Before you start About this tutorial This tutorial teaches you how to develop applications using Cocoon, Wireless Markup Language (WML), and XMLForms. The course is intended for developers and technical managers who want to get an overview of Cocoon and understand how to use Cocoon for application development. Prerequisites To use this tutorial, you should be familiar with basic Java programming, WML, XML, and XSLT. About the authors Vivek Malhotra is a Subject Matter Expert on Wireless Technologies who is based in the Washington D.C. area. Vivek has several years of experience developing and implementing wireless applications and has spoken on expert panels focusing on the wireless industry. You can reach him at [email protected] for any questions you might have about the content of this tutorial. Roman Vichr is senior architect at DDLabs, an e-commerce and EAI consulting company. During the past nine years, his focus has been on database management for client/server and Web applications development.
    [Show full text]
  • Advanced Webapplications Using
    Advanced WebApplications using Reinhard Pötz, Apache Cocoon Comitter [email protected] http://www.poetz.cc CocoonDay, 2003-11-18, Vienna Goals give an overview how to implement Web Applications with Cocoon2 show design patterns focus on the Cocoon Control Flow no details on related aspects but hints after this presentation you should have a starting point for your first application using the Cocoon Control Flow Demo application Thinking in layers ... goals easily maintainable reuseable reached by ... separation of data model enforces view layer clear contracts application flow Page flow city hotel personal data user older user younger than 18 age than 18 car rentals summary Data model Hotel User Car rental City Order database View layer Implementing the Flow layer distributed over all pages page flow is embedded in the hard wired links between the pages (often used in PHP/ASP/JSP applications) hard to understand spathetti code, not maintainable, sideeffects MVC (model view controller) the controller is used to process requests and to select the views (e.g. implemented by the Struts framework or solutions based on Actions in Cocoon) application is fragemented and often it is difficult to understand the logic explicit state handling MVC+ page flow is described as a sequential program using continuations (e.g. Cocoon Advanced Control Flow – using Flowscript) very easy to understand the page flow implicit state handling (continuations) Flowscript – Integration into the Cocoon world [1] <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> <map:flow language="javascript"> <map:script src="flow.js"/> </map:flow> <map:pipelines> <map:pipeline> <map:match pattern="booking.html"> <map:call function="booking"/> </map:match> </map:pipeline> </map:sitemap> Flowscript – Example (flow.js) function booking() { ..
    [Show full text]
  • Basic Web Application Development with Apache Cocoon 2.1
    Basic web application development with Apache Cocoon 2.1 Jasha Joachimsthal ([email protected]) Jeroen Reijn ([email protected]) 4 May 2007 Amsterdam, The Netherlands Basic web application development with Apache Cocoon Are you using Cocoon? Basic web application development with Apache Cocoon Agenda · What is Cocoon? · A bit of history · Cocoon basics · Demo · Why Cocoon? · Future of Cocoon · Q&A Basic web application development with Apache Cocoon What is Cocoon all about? · Web development framework · Java & XML · Separation of Concerns (SoC) · Content transformation · Dynamic multi-channel publishing · Inter-operability with other Java projects (Lucene, FOP, Spring, Hibernate, etc.) Basic web application development with Apache Cocoon History · Cocoon 1 ± Started in Jan. 1999 by Stefano Mazzocchi ± Simple servlet for XSL styling of XML · Cocoon 2 ± Rewrite for performance and scalability ± More than just XSL transformations Basic web application development with Apache Cocoon Connectivity Collect data from multiple resources · Filesystem · SOAP webservice · LDAP · Databases (XML, SQL, Object) · WebDAV · XML feed If that©s not enough, use your current code in Cocoon from · JSF · JSP Basic web application development with Apache Cocoon Connectivity Basic web application development with Apache Cocoon Cocoon basics · Sitemap · Forms framework · Flow · Caching Basic web application development with Apache Cocoon Sitemap · XML configuration file · Request handling · Where everything comes together Basic web application development with Apache
    [Show full text]
  • New Riders Cocoon Building XML Applications.Pdf
    Cocoon: Building XML Applications Matthew Langham Carsten Ziegeler Publisher: New Riders Publishing First Edition July 19, 2002 ISBN: 0-7357-1235-2, 504 pages Front Matter Cocoon: Building XML Applications is a comprehensive hands-on guide to Table of Contents the Apache open source project, Cocoon. Cocoon is an XML publishing About the Author platform already being used by companies such as Hewlett Packard and Examples institutions such as NASA to build their next generation of Internet architectures. Developers, administrators and managers will find this detailed resource an invaluable tool whether you are looking for introductory information on XML/XSL technologies, starting out with the open source platform or seeking a guide to extending Cocoon with additional components. This book combines the knowledge of a key Cocoon developer with the experience of someone who has been building and writing about Internet applications since the early 1990’s. It begins by explaining the advantages of XML, then guides the reader through the process of setting up Cocoon and details the architecture from a user’s as well as a developer’s point of view. The varied examples, from the typical Hello World program to a complete news portal also help to provide an insight into applying open source software to "real world" problems. A detailed reference section documents the various components available in Cocoon and provides the developer with the necessary API documentation. 1 TEAM FLY PRESENTS Table of Content Table of Content ............................................................................................................
    [Show full text]