Tuesday, October 21, 2014

JAR Searcher Developer Tool

As a Java/J2EE developer, I know that the most commonly faced issue in development, which has also been reported as the primary reason for developers losing hair - missing classpath files or not being able to trace a JAR which contains the file - when you know you have all JARs that could possibly exist in this world on your local file system.

Just wrote this simple tool, JarSearcher v1.0, which accepts the name of class file you are looking for and returns all the JARs on your system which contain this file. Also, for Windows developers, I have added a .bat file (Unix folks, kindly replicate .sh) which takes the following form for execution:

js [class-name] [start-in] -c
 
[class-name] The name of the class file to search (without .class)
[start-in] The directory in which to start looking for the files
-c This switch will toggle display of processing information

or you can directly invoke the program from the bundled JAR file:
 
java -jar jar-searcher.jar [class-name] [start-in] -c

I have included the source, feel free to modify it as per your convenience.
 

Tuesday, October 7, 2014

Spring - DWR - Ext JS Chat Application

[GitHub Repository for Code Samples]
https://github.com/sumithpuri/skp-code-marathon-kabootar


I was curious to explore the capabilities of Reverse Ajax. That's when I created this simple chat application using Spring/DWR/Ext JS.

From my experience, I can easily say that DWR is easy to learn and configure, especially when you are planning to integrate with Spring on the application tier. DWR has a powerful API to perform all relevant operations, right from accessing page script sessions to util classes for sending updates to the client.

I used Ext JS for creating the user interface, which renders stunning display for elements like forms, buttons, etc. Ext JS has a very steep learning curve and each operation requires a lot of configuration and reference. Also, I found that the event handling mechanism, though complete, is very complex to use. I relied on external Javascript coding for handling events. On the upside, the documentation and support is really good for this framework. Inspite, I would instantly recommend use of Ext JS for large sized customer facing web-based applications, especially for the internet. For medium scale projects or enterprise based projects, I would think twice.


Login Screen


Chat Screen

Simply, drop the .war file in your web/app server. All dependencies are available in the archive itself. The only external reference is 'servlet-api.jar', which is part of the default lib in all latest containers. The source is packaged separately. Once deployed, the url to access should be: http://[server_name]:[server_port]/kabootar/login.kabootar
If you are trying to figure out what 'Kabootar' means, it's Hindi for 'Pigeon'... 


[GitHub Repository for Code Samples]
https://github.com/sumithpuri/skp-code-marathon-kabootar