Created byDr. Xion March 14, 2012 14:23:14
Last update: March 14, 2012 14:23:14

If forgotPasswordForm.error is a String and not null, you cannot test the error condition with:
<!-- This does not work! -->
<c:if test="${forg...
You have to use "not empty":
<c:if test="${not empty forgotPasswordForm.error}"...

Created byjinxon April 25, 2011 12:43:40
Last update: April 25, 2011 12:43:40

Use the PHP function method_exists to check if the class or object has a certain method. It returns TRUE if the method exists (even when the value of the property is NULL), FALSE if the method does not exist.
Example:
<?php
class A {
var $p = 'A property';
...
Outputs:
Class A has method f1: bool(true)
Object $a has...
Also note that C++-like method overloading does not exist in PHP. Thus there's no ambiguity about which version of the method exists, i.e., with no argument, with one argument... etc. The following code generates Fatal error:
<?php
class A {
var $p = 'A property';
...

Created byjinxon April 25, 2011 11:50:09
Last update: April 25, 2011 11:51:53

Use the PHP function property_exists to check if the class or object has a certain property. It returns TRUE if the property exists (even when the value of the property is NULL), FALSE if the property does not exist, or NULL in case of an error.
Example:
<?php
class A {
var $p = 'A property';
...
Outputs:
Class A has property $p: bool(false)
Class A ha...

Created byDr. Xion March 29, 2011 16:06:57
Last update: April 01, 2011 12:33:52

This utility class retrieves SSL certificates from the server and print them out to the stdout. The output can be saved to a file and imported to a Java keystore. This is useful in your test environment where the SSL certificate is self-signed.
import java.io.InputStream;
import java.io.Outp...
Retrieve and import the a certificate:
E:\test>java RetrieveSSLCert 192.168.69.144 8081 >...

Created byDr. Xion February 09, 2009 23:14:15
Last update: February 09, 2009 23:14:15

This example demonstrates the general steps in creating a custom Java class loader. Normally a class loader would consult its parent class loader when asked to load a class. If it's not loaded by the parent class loader, then the class loader would try to load the class on its own. This class loader tries to load the requested class on its own first, and delegates to the parent only when a java.lang.SecurityException is thrown (which happens when it tries to load core Java classes such as java.lang.String ). The classes are loaded from CLASSPATH through the getResourceAsStream call. It's important to note that when a class is loaded with a certain class loader, all classes referenced from that class are also loaded through the...

Created byDr. Xion 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
...