Monday, 25 May 2009

Pre-compiling JSP and JSF pages

Share
JSP and JSF pages are usually compiled on-the-fly by the application server when accessed for the first time. And to tell the truth Java EE application servers are not the fastest compilers.

When you are a developer and want to re-organise/change some UI components sometimes you have to navigate through few pages until you reach desired JSP/JSF page.

And when your pages are loaded with many JSF components, navigating to third/fourth screen may take some time.

It's much better and much more efficient to pre-compile JSP/JSF pages before packaging the war file.

In this post I will show you how I did it using Apache Ant as a build tool, Apache Jasper as a JSP compiler, and Apache Geronimo as an application server.

Thursday, 21 May 2009

WolframAlpha computational knowledge engine is out there!

Share
WolframAlpha computational knowledge engine is now available to public.

WolframAlpha is not a typical search engine like Google.

It does not give you links to pages which may contain answers to your query - it computes the answer and displays it directly on its page.

Try it yourself at: http://www.wolframalpha.com.

Sunday, 17 May 2009

Spring AOP and Apache Tomcat

Share
AOP is a very powerful programming technique.

I wrote about EJB3 interceptors some time ago. EJB3 interceptors are some sort of simplified aspects. For more information read: Aspect oriented programming in EJB3.

Today I will show you how to use Spring AOP in web application hosted on Apache Tomcat.

Wednesday, 13 May 2009

Virtual machines and Sun's open source VirtualBox

Share
Virtualisers let you create many virtual machines atop one physical machine.

Virtualisation can be used in enterprise-grade systems. If you have a powerful (extremely powerful) machine, you can run many operating systems and simultaneously host applications written in .NET (Windows) and Java EE (Linux/Solaris/Windows).

Also, virtualisation is ideal for R&D projects when you need different heterogeneous machines with their own operating systems and platforms.

Finally, virtualisers can be used by university students. For example, my students use virtualisers during Distributed Processing or Linux Programming laboratories.

Thursday, 7 May 2009

Logging in web applications

Share
In standard web application when something is wrong with the generated content you can simply add ${variableName} into your JSP page and, even without viewing the source code, see its value in your web browser.

But not all web applications produce XHTML or XML content which can be rendered directly in web browser. There are many applications which produce a content which cannot be rendered in standard browser. For example, voice applications produce VoiceXML which can be consumed only by voice browsers of soft-phones or mobile phone emulators.

Also, debugging voice application is not as easily as debugging standard web application. Simply if you wait to long on one of the breakpoints your voice browser will simply time out and end call.

In such circumstances it's highly beneficial to add logging directly into your VoiceXML or any other content your application is generating.

Today I will show you how to use Jakarta's log taglib which is simply a Log4j bridge.

Monday, 4 May 2009

Parameterising JUnit tests

Share
I wanted to write about it last year. But, because of extraordinary lack of time and more interesting stuff I came across during my studies and work, I simply didn't have a chance to write about it.

I wanted to write about it, because I found JUnit 4 and its new parameterised tests feature a little bit overcomplicated and unclear at first sight.

Friday, 1 May 2009

Don't run it, debug it!

Share
There is a common misunderstanding that debugging applications is much slower than running them.

It's not true! You won't see any performance decline while debugging your desktop or even enterprise applications deployed on Java EE servers.

Don't waste your time by adding one-time System.out or log.debug() statements inside your code, simply debug it.

Also debugging is the only one option when something weird is going on in one of your third-party libraries - you just cannot add System.out there :)