Java: Sample Active Directory authentication code

Here is a sample Java code to authenticate against Windows Active Directory server.

  • The code finds all available active directory servers in your network.
  • It uses one of the available active directory server for authentication.
  • If an active directory server is down then it starts using next available server if any.
  • This class is thread-safe, you can create one instance and re-use them multiple times.
  • I tested this code from Linux and Windows box.

You can find the below source code in GitHub as well.
ActiveDirectoryAuthentication.java
Read more of this post

JavaEE – Clustering support in JSF, Wicket, ZK, etc.

When a seasoned MVC framework developer starts writing code in component based framework like JSF, Wicket, ZK, etc. they fail to understand the basic differences between MVC and component based framework because they could write code which can work in non-clustered environment i.e. in single JVM deployment. When the same application is deployed in a clustered environment they start realizing the difference which will require lots of effort revisit all the code and make it compatible for clustering. I am going to talk about a few guidelines on making development (on top of component based framework ) cluster aware.
Read more of this post

There is no language yet available to replace Java!

There is a perception created in the software development industry that Java is out-dated and Ruby, Python, Scala, etc. are going to take over Java’s position. Some “hyper-enthusiasts” are already left Java platform. Sun’s profit model collapse, Applet, Jini, EJB and JSF heavyweight framework failures added fuel to these campaigns. I still believe no language yet available in the market to replace Java. I don’t have to talk why Java is better because it is proven solution for more than a decade but I would like to talk about how false campaigns are created by “hyper-enthusiasts”. It is easy to fall into these false campaigns because as a developer we want new challenges and something new to learn. Read more of this post

Wicket in OC4J / OracleAS

Recently I tried deploying wicket framework based web application in OC4J container it didn’t work, whereas the same code works well in Tomcat. While googling found a few solution which recommends to use wicket servlet configuration instead of servlet filter to resolve the issue. I did the same but no luck. Then I tried associating a bookmarkable page for the homepage then it works well. Here is the code snippet: Read more of this post

Single-Sign-On (SSO) in Java Platform using Active Directory

Sorry guys it been long time writing in my blog.

Nowadays single-sign-on became a hot selling feature for all desktop and web-based products. In this article I talk about single-sign-on implementation in Java platform with Active Directory server. Since Microsoft Windows has become one of the most common corporate network platforms it is worth integrating with your product. Starting from Windows 2000 Microsoft supports Kerberos protocol. It is unusal that Microsoft support open-standard protocol, but they do in this case; good for us :-) Read more of this post

A JSP code to debug class loader issues

Class Loader is one of the complex concept/design to understand in Java programming. On the initial days working with Tomcat and Desktop application there is not much class loading issues. From EJB days class loading became complex by specification and implementation. Seems JavaEE 5 tries to simplify the class loading specification but I don’t know much about that. Read more of this post

Connection Pool vs. Thread Pool Settings

Connection Pool and Thread Pool are used to improve performance of applications. Most of us use these poolings with default settings not caring about their configurations or finding optimal values. But the configuration also an important factor in performance tuning. In some sense the connection pool and the thread pool settings are dependent. We will discuss about the dependency in this post. Read more of this post

Java EE – Performance Tuning Tips

Every application goes through some performance issues whether it is an intranet or internet product. As development progresses, more concentration goes to resolving requirement and technical complexities than performance issues. It is essential to introduce a phase in your development life cycle to tune the product performance before it goes to production. Read more of this post

JSF onload action during restore and render response phase

When comparing JSF with action based frameworks like Struts, Webwork, etc. one of the major missing feature is onload action. Read more of this post

Arbitrary validation in JSF using validator attribute

Recently I was searching for an example about the arbitrary validation in JSF component, found very minimal examples in the web. Here I would like to share my knowledge on this.

Read more of this post

JSF default timezone and date pattern

By default JSF using GMT timezone to convert the date into display format. I did Google search about this issue, found no simple solution to solve this problem.

Here is a simple solution where you can provide your custom date time converter. I like this solution because it fixes GMT date/time issue across the application.

Read more of this post

JSF Best Practices

Here I am documenting some best practices can be followed during JSF project development.

Read more of this post

A critic view on JSF Framework

JSF is becoming more popular framework for user interface layer development, many architects and companies assuming that Struts is becoming outdated and JSF is catching up the market. I am not sure whether it is true at this point of time. However I would like express my critic on the advantages and disadvantages of JSF.

Read more of this post

Don’t let hype push you select wrong technologies

Most of you might agree with title of this blog. But how many of us or our managers/ architects follow on day to day basis? It is still a big question mark???

Read more of this post

Spring Web Flow / Shale Dialog

Recently I got an opportunity to explore Spring Web FlowExternal Link framework. Later I came to know that Shale DialogExternal Link also solves the same problem. JBoss Seam too solves the same problem.

Read more of this post