Recent Notes

Displaying keyword search results 1 - 4
Created by Dr. Xi on January 14, 2010 00:28:27    Last update: March 30, 2011 15:37:44
A task that a Java developer does so frequently is to find out where a certain class can be found - to resolve compilation errors, classpath issues, or version conflicts of the same class introduced by multiple class loaders. A long while back I wrote a simple Perl script to perform the task. Later I was informed that there are Swing based Jar Browser and Jars Browser . Then, there are a couple of shell one-liners: # one liner 1 find -name "*.jar" -print0 | xarg... But all of them share the same problem: if a class is in a jar nested in another jar, it cannot be found. Such is the case for a class inside a jar under the WEB-INF/lib directory of a...
Created by Dr. Xi on October 14, 2008 23:02:29    Last update: October 14, 2008 23:03:50
Wrap JWhich in a servlet: Implement the servlet: package com.example; import java.io.*; ... Add this to web.xml : <servlet> <servlet-name>jwhich</servlet... Request the path for a class or properties file: http://mydomain.com/jwhich/com.example.SomeCla...
Created by Dr. Xi on September 25, 2008 02:58:27    Last update: October 14, 2008 22:49:32
This following code came from a JavaWorld tip, with some minor modifications. public class JWhich { /** * Retu...
Created by Dr. Xi on December 12, 2007 20:30:01    Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf : LoadModule python_module modules/mod_python.so ... Python script: import time, os from os.path import basename ...