Within CQ, Components (including Page Templates) can utilize JSPs for rendering not only HTML, but also other output formats such as JSON.
Unfortunately, many JSPs are written poorly and mix presentation logic with business logic (in the form of scriptlets) making them difficult to test, debug and maintain. One of the best ways to write better JSPs is to never use scriptlets and instead use a combination of EL expressions and Custom Tag Libraries (including the JSTL). This Blueprint details how Custom Tag Libraries should be developed and deployed to a CQ environment.
I just published a new Blueprint over on cqblueprints.com that details how to easily deploy 3rd party libraries into your CQ environment, even when those libraries do not contain the necessary OSGi entries in the Manifest file.
CQ is built on top of Apache Sling, and Apache Sling is built on top of an OSGi container (Apache Felix specifically).
OSGi containers behave slightly differently (in terms of how classes are loaded and made available on the classpath) than most Java developers are used to.
To be able to make classes available within the OSGi container, Jar files need to be packaged in a specific way, including adding extra meta-data to the standard MANIFEST.MF file. The problem this can create is that libraries created by other developers that have not been built with OSGi in mind are missing this extra information and so their Jar files cannot be deployed in CQ.
This Blueprint details how to easily and reliably expose non-OSGi enabled libraries in CQ.
I will be teaching my Java Web Services class starting the week of July 4th, this time around through the University of California Irvine Extension program.
Topics covered include:
Java API for XML Processing (JAXP) – SAX, StAX, DOM, XSLT
This class is 100% online based, with pre-recorded lecture materials available each week. In addition to lecture materials there will be weekly activities varying between forum discussions, quizzes, background reading, and of course coding.
Enrollment is open to everyone and is available right now.
The University of California Irvine Extension program provides an Orientation Week before each class to allow students to become familiar with the virtual classroom environment before formal instruction begins. For this class, the Orientation Week starts on June 27th (i.e. this coming Monday), however you are able to enroll up until the beginning of the formal instruction in the week of July 4th.
If you are interested but have questions about the course content, please comment below and I will answer as quickly as I can. For any questions about the University of California Irvine Extension program, please call Student Services on +1 949 824-5414.
In Part 1 of this series I described the characteristics that make up a good Automated Test. Here in Part 2 of this series I will explore all of the benefits you will enjoy by creating those good tests and why the time spent on making good tests is a no-brainer investment. Continue reading »
The adoption of Automated Testing strategies and tools, both in Agile and traditional teams, has been patchy – some teams and communities have embraced it, but many organizations still perceive it as a burden that just slows down development. Those that see the writing and execution of tests as an additional, costly and separate task from development have missed seeing some of the main benefits of an expertly manicured test suite. Continue reading »
Robert C. Martin, during his keynote at QCon London 2010, tried to figure out why there is so much bad code written. He offers advice on writing good code talking about a bad code example, Boy Scout rule, functions, arguments, craftsmanship, TDD, continuous integration, pairing, small cycles, patterns, engineering, certification, and other elements contributing to qualitative code.
In my previous article (Performance Tuning Resources For Web Clients) I discussed why you should care about the performance of your web client and then listed out some of the better places to go on the web to find information on how to go about tweaking your web clients to get that better performance. In this article I am going to dig a little deeper and call out specifically what I think are the Must-do-No-excuse-not-to-do-them-You-are-really-being-unprofessional-if-you-are-not-doing-them tweaks that you should be performing on every single one of your web development projects. Continue reading »
Recently I have been doing some research on tweaking websites to make them faster (either in reality, or at least in appearance to the client). Specifically the research has been focused on the actual client tier interaction – requesting the page, downloading the assets and rendering the page in the browser. In this post I will document some of the better resources I have found, focusing on client-side tweaks, so these resources should be relevant no matter if you are a Java, PHP, .Net or any other flavor of developer. Continue reading »
JavaOne 2011
Session Title: Dead-Simple Deployment: Headache-Free Java Web Applications in the Cloud
Session ID: 24788
Venue / Room: Hotel Nikko - Carmel I / II / III
Date and Time: 10/6/11, 11:00 - 12:00
Session Title: Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Session ID: 24808
Venue / Room: Hilton San Francisco - Plaza A/B
Date and Time: 10/6/11, 15:30 - 16:30
OCJUG November 2011
I will be speaking at the next meeting of the Orange County Java Users Group on November 10th. The talk will be about Amazon's Elastic Beanstalk service - what it is, how it fits into the other Amazon services and what problems it solves for enterprise Java developers.
For location information and more information about the Orange County Java Users Group, check out their website at http://ocjug.org/.