SlideShare a Scribd company logo
1
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license
Modular web applications based on OSGi
Jochen Hiller
March,18th 2008
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license2
The OSGi HttpService …
•  is lightweight
•  is restricted to Servlet Spec 2.1
  no filters, no listeners, no welcome-files
  no JSP support
•  requires registration at HttpService
  servlets / resources
  programmatically
  via extension point if using Equinox
•  Equinox provides techniques to add missing functionality
  see org.eclipse.equinox.http.helper classes from Simon Kaegi
  but: complex, additional effort required
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license3
A solution: “Web Application Service”
• The web.xml provides all configuration information
• Parse web.xml to …
 register all servlets and filters from contributing bundle
 support specified welcome-files
 add JSP support by default
 add all mime-types, support default mime-types
• Map web application to a context (alias in HttpService terms)
• Resource lookup from contributing bundle
• Binds to all OSGi HttpServices
• The technique: register wrapper servlets
• See https://bugs.eclipse.org/bugs/show_bug.cgi?id=162132
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license4
Web Application Service: The Service API
package org.eclipse.equinox.webapp.service;
public interface WebAppService {
public Object registerWebApp(
String alias,
Bundle bundle,
String bundleResourcePath,
String webXml,
Dictionary options)
throws WebContextException;
public void unregisterWebApp(Object handle);
}
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license5
Web Application Service: As Extension point
<!– web application service as extension point -->
<extension
id="webapp"
name="DemoWebApp“
point="org.eclipse.equinox.webapp.registry.webapp">
<webapp
alias="/"
path="/WebContent">
</webapp>
</extension>
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license6
Web Application Service: As Extender pattern
• Follows Extender Pattern as proposed by OSGi
• Bundle Listener observes all bundles coming / leaving
the platform
• Trigger file is /WEB-INF/web.xml
• Context to register is bundle symbolic name
 May be configured through /WEB-INF/osgi-web.xml
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license7
What are the benefits?
• Easy development of JavaEE based web applications
based on OSGi
• Simplified deployment of existing web applications
(WAR) to OSGi
• OSGi can act as a lightweight web container
• Implementation is not dependent on OSGi runtime
implementation
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license8
Demo: Deploy Tomcat examples
• Tomcat 5.5.x example applications
 servlet-examples
 jsp-examples
• Changes required:
 Create /META-INF/MANIFEST.MF
 Added /WEB-INF/classes and /WEB-INF/lib/*.jar to
bundle classpath
 May be automated using bnd tool from Peter Kriens
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license9
Limitations, Plans
• And what is missing?
 Taglib support is missing
 Listeners not yet supported
 Declarative security not supported
 Implementation under development, API may change
 Documentation, Tutorials
 More testing (e.g. compatibility with servlet bridge, other
OSGi implementations)
• Further ideas:
 Equinox specific framework extension to directly support
loading WAR files
 Align with Enterprise OSGi and RFC 66 activities
Modular web applications based on OSGi | March 18th 2008 | Short Talk #244
© Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed
under Creative Commons Att. Nc Nd 2.5 license10
Questions?
• Contact me:
 jo.hiller@googlemail.com
• Incubator project at:
 http://sourceforge.net/projects/sse-examples
 CVS, webapp-incubator

More Related Content

What's hot (20)

PDF
Who needs containers in a serverless world
Matthias Luebken
 
PDF
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
ITCamp
 
PDF
A microservice architecture based on golang
Gianfranco Reppucci
 
PDF
Enabling Devops using Jenkins
Patrick Hynes
 
PDF
QtWS15 Revolutionizing Automotive with Qt
Johan Thelin
 
PDF
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
Codemotion
 
PDF
You and your containers: strumenti di automazione in Cloud (parte 2) - Gabrie...
Codemotion
 
PDF
The State of libfabric in Open MPI
Jeff Squyres
 
PPTX
Media processing with serverless architecture
Kensaku Komatsu
 
PDF
Qt Automotive Suite - under the hood // Qt World Summit 2017
Johan Thelin
 
PDF
Open-source RPA: Leveraging Python and Robot Framework ecosystems for busines...
All Things Open
 
PDF
Control Kubernetes Ingress and Egress Together with NGINX
NGINX, Inc.
 
PDF
Introduction to Jenkins X - a beginner's guide
Andrew Bayer
 
PDF
Future of Microservices - Jakub Hadvig
WEBtlak
 
PDF
CSV and JSON Transformation in WSO2 Micro Integrator 4.0 - WSO2 APIM Communit...
WSO2
 
PDF
Open Source on Wheels - Tech Day by Init 2017
Johan Thelin
 
PDF
Implementing API-led Cloud-native apps on OCI
Sven Bernhardt
 
PDF
OpenAPI Generator The Babel Fish of The API World - apidays Live Australia
Cliffano Subagio
 
PPT
Compare framework
Tomasz Zarna
 
PDF
The best of Hyper-V 2016 - Thomas Maurer
ITCamp
 
Who needs containers in a serverless world
Matthias Luebken
 
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
ITCamp
 
A microservice architecture based on golang
Gianfranco Reppucci
 
Enabling Devops using Jenkins
Patrick Hynes
 
QtWS15 Revolutionizing Automotive with Qt
Johan Thelin
 
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
Codemotion
 
You and your containers: strumenti di automazione in Cloud (parte 2) - Gabrie...
Codemotion
 
The State of libfabric in Open MPI
Jeff Squyres
 
Media processing with serverless architecture
Kensaku Komatsu
 
Qt Automotive Suite - under the hood // Qt World Summit 2017
Johan Thelin
 
Open-source RPA: Leveraging Python and Robot Framework ecosystems for busines...
All Things Open
 
Control Kubernetes Ingress and Egress Together with NGINX
NGINX, Inc.
 
Introduction to Jenkins X - a beginner's guide
Andrew Bayer
 
Future of Microservices - Jakub Hadvig
WEBtlak
 
CSV and JSON Transformation in WSO2 Micro Integrator 4.0 - WSO2 APIM Communit...
WSO2
 
Open Source on Wheels - Tech Day by Init 2017
Johan Thelin
 
Implementing API-led Cloud-native apps on OCI
Sven Bernhardt
 
OpenAPI Generator The Babel Fish of The API World - apidays Live Australia
Cliffano Subagio
 
Compare framework
Tomasz Zarna
 
The best of Hyper-V 2016 - Thomas Maurer
ITCamp
 

Viewers also liked (20)

PDF
2016 01 cv karine hustinx
Karine Hustinx
 
PDF
Aviso de Costos Unitarios IMSS 2016
El Nido de la Seguridad Social
 
DOCX
ML C.V 4
Mohammed Elleboudi
 
DOCX
resume-CJ
courtney wells
 
PDF
Vehicle Consumer Services Interface - In-Vehicle Middleware - Vladimir Rasin,...
mfrancis
 
PDF
In Homes / Consumer Electronics - M Beltrami
mfrancis
 
PDF
OSGi DevCon - Innovation Through an Apps Competition
mfrancis
 
PDF
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
mfrancis
 
PDF
Microsoft Automotive Business Unit - J Za
mfrancis
 
PDF
OSGi Users' Forum UK - Meeting 23rd June 2011
mfrancis
 
PDF
OSGi Community Event 2010 - A Crash Course in OSGi Application Development
mfrancis
 
PDF
OSGi Users' Forum UK Meeting 3
mfrancis
 
PDF
In the Services Network - HW Bitzer
mfrancis
 
PDF
OSGi World Congress 2003 - Welcome, Introduction - D Kamlani
mfrancis
 
PDF
2005 OSGi Alliance World Congress Day Two - John R. Barr, Ph.D., Chair OSGi W...
mfrancis
 
PDF
OSGi World Congress 2002 Summary - J Barr
mfrancis
 
PDF
OSGi Community Event 2007 - Closing Remarks - Dan Bandera, Member of the Boar...
mfrancis
 
PDF
The Business Case for OSGi Technology & Unveiling Release 4 - Susan Schwarze,...
mfrancis
 
PDF
e-PASTA - A Kung
mfrancis
 
PDF
OSGi Technology Based Product-Service Packages for Multi-tenant-Mudwelling Re...
mfrancis
 
2016 01 cv karine hustinx
Karine Hustinx
 
Aviso de Costos Unitarios IMSS 2016
El Nido de la Seguridad Social
 
resume-CJ
courtney wells
 
Vehicle Consumer Services Interface - In-Vehicle Middleware - Vladimir Rasin,...
mfrancis
 
In Homes / Consumer Electronics - M Beltrami
mfrancis
 
OSGi DevCon - Innovation Through an Apps Competition
mfrancis
 
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
mfrancis
 
Microsoft Automotive Business Unit - J Za
mfrancis
 
OSGi Users' Forum UK - Meeting 23rd June 2011
mfrancis
 
OSGi Community Event 2010 - A Crash Course in OSGi Application Development
mfrancis
 
OSGi Users' Forum UK Meeting 3
mfrancis
 
In the Services Network - HW Bitzer
mfrancis
 
OSGi World Congress 2003 - Welcome, Introduction - D Kamlani
mfrancis
 
2005 OSGi Alliance World Congress Day Two - John R. Barr, Ph.D., Chair OSGi W...
mfrancis
 
OSGi World Congress 2002 Summary - J Barr
mfrancis
 
OSGi Community Event 2007 - Closing Remarks - Dan Bandera, Member of the Boar...
mfrancis
 
The Business Case for OSGi Technology & Unveiling Release 4 - Susan Schwarze,...
mfrancis
 
e-PASTA - A Kung
mfrancis
 
OSGi Technology Based Product-Service Packages for Multi-tenant-Mudwelling Re...
mfrancis
 
Ad

Similar to Modular Web Applications based on OSGi - Jochen Hiller (20)

PDF
Building Server-Side Eclipse based web applications 2010
Gunnar Wagenknecht
 
PDF
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Nuxeo
 
PDF
Building Server-Side Eclipse based web applications
Gunnar Wagenknecht
 
PDF
Monoliths are so 2001 – What you need is Modularity
Graham Charters
 
PDF
Travelling light for the long haul
Ian Robinson
 
PDF
Travelling Light for the Long Haul - Ian Robinson
mfrancis
 
PDF
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
mfrancis
 
PDF
WSO2 Application Server
Sagara Gunathunga
 
KEY
Introduction to EclipseRT (JAX 2010)
Chris Aniszczyk
 
PPT
Osgi Webinar
WSO2
 
KEY
First Touch with OSGi
Owen Ou
 
PDF
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
Sanjeeb Sahoo
 
KEY
Jug Poitou Charentes - Apache, OSGi and Karaf
Guillaume Nodet
 
PDF
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
mfrancis
 
KEY
Apache, osgi and karaf par Guillaume Nodet
Normandy JUG
 
PDF
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OpenBlend society
 
KEY
Lessons learned Building Nuxeo EP - Component-based, open source ECM platform
Nuxeo
 
PDF
Modular Java EE in the Cloud
Bert Ertman
 
PPT
java web services - soap and rest services
VasantPrasad
 
PDF
April 2010 - JBoss Web Services
JBug Italy
 
Building Server-Side Eclipse based web applications 2010
Gunnar Wagenknecht
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Nuxeo
 
Building Server-Side Eclipse based web applications
Gunnar Wagenknecht
 
Monoliths are so 2001 – What you need is Modularity
Graham Charters
 
Travelling light for the long haul
Ian Robinson
 
Travelling Light for the Long Haul - Ian Robinson
mfrancis
 
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
mfrancis
 
WSO2 Application Server
Sagara Gunathunga
 
Introduction to EclipseRT (JAX 2010)
Chris Aniszczyk
 
Osgi Webinar
WSO2
 
First Touch with OSGi
Owen Ou
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
Sanjeeb Sahoo
 
Jug Poitou Charentes - Apache, OSGi and Karaf
Guillaume Nodet
 
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
mfrancis
 
Apache, osgi and karaf par Guillaume Nodet
Normandy JUG
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OpenBlend society
 
Lessons learned Building Nuxeo EP - Component-based, open source ECM platform
Nuxeo
 
Modular Java EE in the Cloud
Bert Ertman
 
java web services - soap and rest services
VasantPrasad
 
April 2010 - JBoss Web Services
JBug Italy
 
Ad

More from mfrancis (20)

PDF
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
mfrancis
 
PDF
OSGi and Java 9+ - BJ Hargrave (IBM)
mfrancis
 
PDF
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
mfrancis
 
PDF
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
mfrancis
 
PDF
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
mfrancis
 
PDF
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
mfrancis
 
PDF
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
mfrancis
 
PDF
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
mfrancis
 
PDF
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
PDF
OSGi CDI Integration Specification - Ray Augé (Liferay)
mfrancis
 
PDF
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
PDF
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
PDF
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
mfrancis
 
PDF
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
mfrancis
 
PDF
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
mfrancis
 
PDF
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
mfrancis
 
PDF
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
mfrancis
 
PDF
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
mfrancis
 
PDF
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 
PDF
How to connect your OSGi application - Dirk Fauth (Bosch)
mfrancis
 
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
mfrancis
 
OSGi and Java 9+ - BJ Hargrave (IBM)
mfrancis
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
mfrancis
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
mfrancis
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
mfrancis
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
mfrancis
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
mfrancis
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
mfrancis
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
mfrancis
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
mfrancis
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
mfrancis
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
mfrancis
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
mfrancis
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 
How to connect your OSGi application - Dirk Fauth (Bosch)
mfrancis
 

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
July Patch Tuesday
Ivanti
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
July Patch Tuesday
Ivanti
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 

Modular Web Applications based on OSGi - Jochen Hiller

  • 1. 1 Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license Modular web applications based on OSGi Jochen Hiller March,18th 2008
  • 2. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license2 The OSGi HttpService … •  is lightweight •  is restricted to Servlet Spec 2.1   no filters, no listeners, no welcome-files   no JSP support •  requires registration at HttpService   servlets / resources   programmatically   via extension point if using Equinox •  Equinox provides techniques to add missing functionality   see org.eclipse.equinox.http.helper classes from Simon Kaegi   but: complex, additional effort required
  • 3. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license3 A solution: “Web Application Service” • The web.xml provides all configuration information • Parse web.xml to …  register all servlets and filters from contributing bundle  support specified welcome-files  add JSP support by default  add all mime-types, support default mime-types • Map web application to a context (alias in HttpService terms) • Resource lookup from contributing bundle • Binds to all OSGi HttpServices • The technique: register wrapper servlets • See https://bugs.eclipse.org/bugs/show_bug.cgi?id=162132
  • 4. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license4 Web Application Service: The Service API package org.eclipse.equinox.webapp.service; public interface WebAppService { public Object registerWebApp( String alias, Bundle bundle, String bundleResourcePath, String webXml, Dictionary options) throws WebContextException; public void unregisterWebApp(Object handle); }
  • 5. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license5 Web Application Service: As Extension point <!– web application service as extension point --> <extension id="webapp" name="DemoWebApp“ point="org.eclipse.equinox.webapp.registry.webapp"> <webapp alias="/" path="/WebContent"> </webapp> </extension>
  • 6. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license6 Web Application Service: As Extender pattern • Follows Extender Pattern as proposed by OSGi • Bundle Listener observes all bundles coming / leaving the platform • Trigger file is /WEB-INF/web.xml • Context to register is bundle symbolic name  May be configured through /WEB-INF/osgi-web.xml
  • 7. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license7 What are the benefits? • Easy development of JavaEE based web applications based on OSGi • Simplified deployment of existing web applications (WAR) to OSGi • OSGi can act as a lightweight web container • Implementation is not dependent on OSGi runtime implementation
  • 8. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license8 Demo: Deploy Tomcat examples • Tomcat 5.5.x example applications  servlet-examples  jsp-examples • Changes required:  Create /META-INF/MANIFEST.MF  Added /WEB-INF/classes and /WEB-INF/lib/*.jar to bundle classpath  May be automated using bnd tool from Peter Kriens
  • 9. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license9 Limitations, Plans • And what is missing?  Taglib support is missing  Listeners not yet supported  Declarative security not supported  Implementation under development, API may change  Documentation, Tutorials  More testing (e.g. compatibility with servlet bridge, other OSGi implementations) • Further ideas:  Equinox specific framework extension to directly support loading WAR files  Align with Enterprise OSGi and RFC 66 activities
  • 10. Modular web applications based on OSGi | March 18th 2008 | Short Talk #244 © Copyright 2008 Jochen Hiller; Source code in this presentation is made available under the EPL v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license10 Questions? • Contact me:  [email protected] • Incubator project at:  http://sourceforge.net/projects/sse-examples  CVS, webapp-incubator