December 2003
Total Page:16
File Type:pdf, Size:1020Kb
DCU DUBLIN CITY UNIVERSITY SCHOOL OF ELECTRONIC ENGINEERING The YBox - A Front-E nd Processing Engine for W eb Com m unity based A pplications Liam Fraw ley December 2003 MASTER OF ENGINEERING IN ELECTRONIC SYSTEMS Supervised by Dr. D. M olloy The YBox - A Front-End Processing Engine for Web Community based Applications Acknowledgements I would like to thank my supervisor Dr. Derek Molloy for his guidance, enthusiasm and commitment to this project. I would also like to thank my family for their patience throughout the entire project Finally I would like to express my deep appreciation to Fiona for her support and understanding over the past two and a half years. The YBox - A Front-End Processing Engine for Web Community based Applications Declaration I hereby declare that, except where otherwise indicated, this document is entirely my own work and has not been submitted in whole or in part to any other university. Date: 2 .1 -0 2 - Ù3 iii The YBox - A Front-End Processing Engine for Web Community based Applications A b stract This document describes the YBox framework that enables web application developers to rapidly develop web applications for the Java 2 Enterprise Edition (J2EE) platform, The YBox is a fully implemented and tested framework that provides a “front-end” for Servlet Containers and contains functionality that all user- based web applications for virtual communities require. The YBox extends the functionality of the Servlet Container and the Servlet 2.3 API and is implemented in a platform independent manner, which means the YBox will run on any operating system or any Servlet Container. As a result of extra functionality added by the YBox, the presentation logic is clearly separated from the business logic in a web application. This also enables the web application to provide content to more client types and automatically perform form validation on all web forms submitted from clients. The YBox framework also allows the web application designer to control access to protected content from one central resource. Finally, the YBox framework enables session persistence across multiple sessions, therefore, user information is not lost between sessions. The YBox - A Front-End Processing Engine for Web Community based Applications Table of Contents A C K NO W LEDG EM EN TS.....................................................................................................II DECLARATION........................................................................................................................ I ll A BSTRA C T..................................................................................................................................IV TABLE O F C O N TEN T S..........................................................................................................V TABLE OF FIGURES...........................................................................................................VIII CHAPTER 1 - INTRODUCTIO N........................................................................................... 1 1.1. Overview of Web Applications................................................................................. 2 1.2 . H isto ry o f Web A p p lica tio n s.....................................................................................4 1.3. The J2EE Fram ew ork......................................................................................................5 1.4 . The .NET F ram ew ork .................................................................................................... 6 1.5. O verview o f Y B o x .......................................................................................................... 8 1.5.1. Content Presentation................. ................................................................ 9 1.5.2. Form Validation............................................................................. ..........10 1.5.3. Session Management...................................................................... 11 1.5.4. Security.......................................................................................................11 1.6. C o n tr ib u tio n s................................................................................................................ 12 1.7 . O r g a n isa tio n ...................................................................................................................13 CHAPTER 2 - BACKGROUND TECHNOLOGY REVIEW ................................... 14 2 .1. S e c u r ity ............................................................................................................................. 15 2.1.1. Security with Servlet 2.2 A P I....................................... ........................... 15 2.1.2. Security with Servlet 2.3 API..................................................................17 2 .2 . M u ltip le C lien ts and C o n ten t P r e se n ta tio n ...................................................19 2.2.1. Separate content fo r different clients....................................................... 20 2.2.2. Cocoon from Apache................................................................................. 21 2 .3 . Form V a lid a tio n ........................................................................................................... 24 2.3.1. Client Side Validation................................................................................ 25 2.3.2. Java based Server Side Validation.......................................................... 26 2.3.3. Form Validation using the Form Processing AP I................................30 2 .4 . HTTP Session M an agem en t.......................................................................................31 v The YBox - A Front-End Processing Engine for Web Community based Applications 2.4.1. Overview o f Sessions....... ...........................................................................31 2.4.2. Example o f a Session............................................................. ................... 32 2.4.3. Problems associated with Sessions...........................................................34 2.4.4. Servlet Container Implementation of Session Persistence......................35 2 .5. Sum m ary........................................................................................................................... 35 CHAPTER 3 - DESIGN OF THE YBOX .......................................................................... 37 3 .1. R equirem ents o f th e Y B o x ....................................................................................... 38 3.1.1. Content Presentation......................... ....................................................... 38 3.1.2. Security Requirement................................................................................. 39 3.1.3. Form Validation Requirement................................ ................................. 39 3.1.4. Session Management Requirement..........................................................40 3 .2 . Analysis of the YBox Design .................................................................................. 40 3.2.1. Analysis o f Content Presentation..............................................................41 3.2.2. Analysis o f Security in the YBox...............................................................44 3.2.3. Analysis o f Form Validation.....................................................................48 3.2.4. Analysis o f Session Management..............................................................53 3 .3 . Sum mary............................................................................................................................55 CHAPTER 4 - IM PLEM ENTATION OF THE Y BO X................................................56 4 .1. The C on figu ration F ile .............................................................................................. 56 4.1.1. Accessing the Configuration File............................................................. 57 4.1.2. The Structure o f the Configuration File....................................................59 4.1.3. Loading the Configuration File................................................................ 61 4.1.4. Storing the Configuration Information.....................................................66 4 .2 . C o n ten t P r e se n ta tio n ................................................................................................68 4.2.1. Static Content - Flat Files..........................................................................69 4.2.2. Dynamic Content - Servlets andJSPs......................................................73 4 .3. S e c u r ity .............................................................................................................................78 4.3.1. URL o f the requested resource..................................................................79 4.3.2. The User making the request.....................................................................79 4.3.3. Access permissions..................................................................................... 80 4 .4 . Form V a lid a tio n ........................................................................................................... 84 4.4.1. Instantiating a requested Servlet..............................................................84 The YBox - A Front-End Processing Engine for Web Community based Applications 4.4.2. Using Reflection to invoke methods........