Home

Author Archive

Don’t clutter your code with isDebugEnabled

Tuesday, June 09th, 2009 | Author: FoX

The main function of a good logging implementation is to provide a clear overview of the functioning of a system. Basically, the logging must describe the inner workings of a system and provide the necessary details to the readers of the log. In fact, good logging can drastically reduce maintenance costs of your applications, especially for clustered systems.

Logging is a crucial part of every system and provides all the information about the state of a system. The key is to provide this information without cluttering the code too much with these logging statements.

Most programmers tend to use a decent logging mechanism in their applications, but few of them use it elegantly. How can we make sure that we don’t clutter our code with unnecessary statements that reduce readability?

more…

Category: Development | 12 Comments

Partial page refresh with AJAX and JQuery

Tuesday, March 17th, 2009 | Author: FoX

From time to time I need some kind of mechanism to continuously refresh a web page in order to provide a real-time dashboard of some kind. It would be great if I only could refresh a part of a specific page, for example: the traffic lights on a dashboard that indicate the status of the system.

It is really easy to only refresh a part of the page by using the JQuery JavaScript library. Once we’ve included the JQuery library into our page, we only need 1 line of JavaScript to get it working:

<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>

So we just place this little JS code snippet into our page to refresh everything inside the tag with the content id, let’s say every 5 seconds:

setInterval(function() {
    $("#content").load(location.href+" #content>*","");
}, 5000);

That’s it!! It is thus fairly easy to accomplish some real-time monitoring behavior with just that line of code. No more weird meta-refresh tags or iframe kind of workarounds in your web applications.

Every 5 seconds, we will refresh the content of the element with the content of the same URL and all elements that reside under the element with id: content.

Quite nice, don’t you think? JQuery certainly allows you to apply some very powerful techniques in just a few lines of code. I like it.. a lot!

Category: Development | 8 Comments

WebSphere Portal 6.1 Performance Tuning on Windows

Wednesday, March 04th, 2009 | Author: FoX

It would be too hard explaining all configuration details about tuning the performance on a WebSphere Portal Server (WPS) as these rely heavily on the chosen infrastructure. I will however provide a nice troubleshooting guide that allows you to track down the performance bottlenecks on your WebSphere Portal environment.

IBM WebSphere Portal software provides an enterprise SOA based solution to build core portal services that aggregate applications and content as role-based applications.

When starting with performance tuning, it is important to begin with a baseline, monitor the performance metrics to determine if any parameters should be changed and monitor the performance metrics again to determine the effectiveness of the change.

In short, you need to measure, measure… and then just measure once again.

What do you need to do in order to start performance tuning on WebSphere Portal? more…

Category: WebSphere | 2 Comments

What’s new in WebSphere 7.0

Tuesday, December 30th, 2008 | Author: FoX

WebSphere
IBM has recently released a new version of their application server platform: WebSphere Application Server 7.0.

The release of WAS 7.0 brings us new possibilities in developing JEE based applications. Besides the upgrade of the Java standards, there are also major platform improvements.

What technical enhancements can I expect from WAS 7.0?

more…

Category: WebSphere | Comments off

J2EE Development without Spring

Friday, September 26th, 2008 | Author: FoX

Spring Source has changed its maintenance policy (press release). From now on we’ll have to buy commercial support for maintenance releases of the Spring framework if we still want support after 3 months. This worries me a lot as Spring was becoming the defacto standard in J2EE development.

The need for a new book on Java EE is rising and I already got a perfect title for it! How would “J2EE Development without Spring” sound like? The cover ;) :

J2EE Development without Spring

This book would explain how you could still be agile in your development environments, without breaking your codebase and how you can get around the problems Spring currently has: too bloated, a lot of functionality and a lot of ways to get something done (annotations, various xml configs to do the same).

more…

Category: Spring | 16 Comments

NTLM with Spring Security 2.0

Thursday, June 05th, 2008 | Author: FoX

A lot of users are having trouble when dealing with NTLM based authentication with Spring Security. The underlying NTLM support is built on top of JCIFS (jcifs.samba.org), an open source client library that implements the CIFS/SMB networking protocol in Java.

NTLM authentication allows the login credentials of a Windows user, who is logged on into a domain, to be automatically passed to your browser.
NTLM is a Microsoft-developed protocol providing single sign-on capabilities to web applications. It allows a web server to automatically discover the username of a browser client when that client is logged into a Windows domain and is using an NTLM-aware browser. A web application can then reuse the user’s Windows credentials without having to ask for them again.

This only works for Internet Explorer. When using Firefox, you will be prompted with an authentication prompt where you can enter your username and password. You can enable NTLM authentication also in Firefox, by doing the following steps:

  • Type “about:config” in the address bar of Firefox
  • You will see all settings of Firefox, but you need to find the key “network.automatic-ntlm-auth.trusted-uris”.
  • Enter the hostnames like: “host1.domain.com, host2.domain.com”
    or just “.domain.com” to list them all at once

Once you have setup your project with the correct dependencies and libraries, we are ready to start configuring our application context. You need spring-security-core and spring-security-ntlm as project dependencies in order to get it working.

more…

Category: Spring | 17 Comments