What Is CDI, How Does It Relate to @EJB And Spring?

A brief overview of dependency injection in Java EE, the difference between @Resource/@EJB and @Inject, and how does that all relate to Spring – mostly in the form of links. Context Dependency Injection (CDI, JSR 299) is a part of Java EE 6 Web Profile and itself builds on Dependency Injection for Java (JSR 330),Continue reading “What Is CDI, How Does It Relate to @EJB And Spring?”

Most interesting links of October

Recommended Readings Steve Yegge’s Execution in the Kingdom of Nouns – I guess you’ve already read this one but if not – it is a well-written and amusing post about why not having functions as first class citizens in Java causes developers to suffer. Highly recommended. Reply to Comparing Java Web Frameworks – a veryContinue reading “Most interesting links of October”

JSF: Beware the Difference Between Build-Time and Render-Time Tags in Facelets

This is to remind me that I should never ever forget the cruical difference between build-time-only tags (i.e. having tag handlers only) and render-time tags that have corresponding components. The problem is that their lifespan is different and thus mixing them can easily lead to nasty surprises. Build time tags are used to modify theContinue reading “JSF: Beware the Difference Between Build-Time and Render-Time Tags in Facelets”

Intro: Java Webapp Monitoring with Hyperic HQ + How to Alert on Too Many Errors in Logs

This post describes how to set up the Java-based open source monitoring tool Hyperic HQ to monitor application server error logs and send a single warning e-mail when there are more of them than a threshold. In the previous post Aggregating Error Logs to Send a Warning Email When Too Many of Them – Log4j,Continue reading “Intro: Java Webapp Monitoring with Hyperic HQ + How to Alert on Too Many Errors in Logs”

Aggregating Error Logs to Send a Warning Email When Too Many of Them – Log4j, Stat4j, SMTPAppender

Our development team wanted to get notified as soon as something goes wrong in our production system, a critical Java web application serving thousands of customers daily. The idea was to let it send us an email when there are too many errors, indicating usually a problem with a database, an external web service, orContinue reading “Aggregating Error Logs to Send a Warning Email When Too Many of Them – Log4j, Stat4j, SMTPAppender”

Inspect Your Webapp in a Live Environment Interactively with GroovyConsole

Have you ever needed to check the state of your webapp’s objects/Session/.. to find out why the hell something doesn’t work or have you had to learn a weird 3rd party API that is only available on the server? Then you were doomed … until the publication of GroovyConsole. JeeUtils GroovyConsole provides a JSP page thatContinue reading “Inspect Your Webapp in a Live Environment Interactively with GroovyConsole”

Experiencing JSF 1.2: Good but Needs a Framework

I’ve got an opportunity to experiment with JSF 1.2 while preparing a lecture about DbUnit Express and test webapp for JSF EL Validator. Same as JSF 1.1, it’s much easier to use than the low level, too HTTP-ish servlets but still it is not flexible enough and usable per se, it is absolutely necessary toContinue reading “Experiencing JSF 1.2: Good but Needs a Framework”

Validating JSF EL Expressions in JSF Pages with static-jsfexpression-validator

Update: Version 1.0 was released in March 2012 Update: Version 0.9.9 with finished basic support for Facelets (autodetection of annotated beans, handling of ui:repeat) is available Update: Version 0.9.7 with experimental Facelets support and a fix of method binding validation released in Nov. (Not mentioning 0.9.5 and .6.) Always check the latest version available! TheContinue reading “Validating JSF EL Expressions in JSF Pages with static-jsfexpression-validator”

Hacking Jasper to Get Object Model of a JSP Page

To perform some checks and statistical analysis on my JSPs I needed a DOM-like, hierarchical model of elements contained in them. But parsing JSP pages isn’t trivial and is best left to a tool that excels in it – the Jasper JSP compiler used by Tomcat, Jetty, GlassFish and likely also by all others. ThereContinue reading “Hacking Jasper to Get Object Model of a JSP Page”

Version hell with JSFUnit, Arquillian, and (embedded) Glassfish and other containers

JSFUnit and the JBoss Arquillian test framework for JavaEE look very promissing, but according to my experience there are good reasons why they are only beta and alpha versions. May be you can get them working but you must pick the right version of each dependency – for many things change between individual versions atContinue reading “Version hell with JSFUnit, Arquillian, and (embedded) Glassfish and other containers”