Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
 Breathing new life into JSP with OSGi! 
Why Bother??? 
Raymond Augé <raymond.auge@liferay.com> 
 @rotty3000 | #OSGi #ec...
 Outline 
 JSP!!! What’s the 
meaning of this? 
 Bytecode is Better 
 Initial Problems 
 Compiling 
 Designing a Sol...
 JSP!!! What’s the meaning of this? 
Isn’t JSP a dead tech? 
Enterprises use JSP a lot 
find ­type 
f ­regex 
.*.jspf? | ...
 Bytecode is Better 
Compiled to Bytecode view templates still most efficient server 
side 
w.r.t. memory consumption and...
 Initial Problems 
Java EE instantiation model (ServiceLoader, Class.forName, 
TCCL) 
Limitations to the existing JSP ser...
 Compiling 
Traditionally ­JDT 
load the world compilation strategy 
JDT is not a small dependency 
Other compilation opt...
 Designing a Solution 
Re­use 
existing tech when possible 
Use JDK compiler API (since Java 6) 
Avoid lots of hacks 
Kee...
 Key Java EE OSGi Bundles 
Key API/RIs are OSGi bundles 
Servlet 
JSP 
JSTL 
EL 
Thanks Glassfish!
 Jasper 
Proven and stable 
Has limited dependencies 
Recently solved issues enabling easier OSGi use 
Thanks Glassfish!
 Java SE Support ­javax. 
tools 
Since Java SE 6 
Full blown compiler support 
.. complicated to use
 OSGi Support ­org. 
osgi.framework.wiring 
Since Core R4.3 
Deep classloader & wiring resource access
 Phidias 
Small OSS bundle which crosses 
javax.tools 
org.osgi.framework.wiring 
Provides simplified OSGi aware compiler...
 Liferay JSP Compiler 
Extends Jasper with custom 
JSP compiler which uses Phidias 
JSP servlet which transparently handl...
No need to include any libs or standard TLDs 
No need to WAB your bundles 
Can use regular old jar layout + web fragment s...
 Demo Time 
A Quick DEMO
 OSGi Aware Compilation 
Does this open the door for other interesting topics? 
Limit compile time view of the world to p...
 Thank you! 
Questions?
Upcoming SlideShare
Loading in …5
×

Breathing new life into JSP with OSGi? Why!!! - R Auge

779 views

Published on

OSGi Community Event 2014

Abstract:
Experience level: Intermediate

JSP is a legacy UI model developed in the early days of Java EE (back when it was still J2EE). In spite if it's many proclaimed drawbacks, it has persisted until today in many applications and is still widely used while being despised by many. In this talk we'll explore the reasons why anyone would implementing support for such a hated technology in OSGI and how such an implementation might actually breath new life into it.

Speaker - Raymond Auge (Liferay Inc.)

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Breathing new life into JSP with OSGi? Why!!! - R Auge

  1. 1.  Breathing new life into JSP with OSGi! Why Bother??? Raymond Augé <raymond.auge@liferay.com>  @rotty3000 | #OSGi #eclipsecon #jspinosgi
  2. 2.  Outline  JSP!!! What’s the meaning of this?  Bytecode is Better  Initial Problems  Compiling  Designing a Solution  Key Java EE OSGi Bundles  Jasper  Compilation ­javax. tools  OSGi Support ­org. osgi.framework.wiring  Phidias  Liferay JSP Compiler  Some Details  Demo Time
  3. 3.  JSP!!! What’s the meaning of this? Isn’t JSP a dead tech? Enterprises use JSP a lot find ­type f ­regex .*.jspf? | wc ­l Eclipse = 59 Liferay = 1696 Liferay Plugins = 669
  4. 4.  Bytecode is Better Compiled to Bytecode view templates still most efficient server side w.r.t. memory consumption and performance Other compiled to bytecode view tech not as widely known Play Scala Templates Google Soy Templates
  5. 5.  Initial Problems Java EE instantiation model (ServiceLoader, Class.forName, TCCL) Limitations to the existing JSP servlet impls required ugly hacks Compilation dependencies lead to complex runtime dependencies
  6. 6.  Compiling Traditionally ­JDT load the world compilation strategy JDT is not a small dependency Other compilation options non­existent OSGi had no way to natively support compilation process
  7. 7.  Designing a Solution Re­use existing tech when possible Use JDK compiler API (since Java 6) Avoid lots of hacks Keep a small footprint Limit usage requirements
  8. 8.  Key Java EE OSGi Bundles Key API/RIs are OSGi bundles Servlet JSP JSTL EL Thanks Glassfish!
  9. 9.  Jasper Proven and stable Has limited dependencies Recently solved issues enabling easier OSGi use Thanks Glassfish!
  10. 10.  Java SE Support ­javax. tools Since Java SE 6 Full blown compiler support .. complicated to use
  11. 11.  OSGi Support ­org. osgi.framework.wiring Since Core R4.3 Deep classloader & wiring resource access
  12. 12.  Phidias Small OSS bundle which crosses javax.tools org.osgi.framework.wiring Provides simplified OSGi aware compiler support Alpha (0.3.4)
  13. 13.  Liferay JSP Compiler Extends Jasper with custom JSP compiler which uses Phidias JSP servlet which transparently handles classloading concerns  Some Details Entire JSP support ~ 1.3MB Most modern versions of JSP, JSTL, EL available No need to declare any JSP related imports in JSP enabled bundles
  14. 14. No need to include any libs or standard TLDs No need to WAB your bundles Can use regular old jar layout + web fragment subtree Place JSPs in META­INF/ resources/
  15. 15.  Demo Time A Quick DEMO
  16. 16.  OSGi Aware Compilation Does this open the door for other interesting topics? Limit compile time view of the world to public APIs?
  17. 17.  Thank you! Questions?

×