23 April 2009
Type safe JSP and JSTL
When using JavaServer Pages, you want to use JSTL to be able to to flow-control (iterations and conditionals) in a reasonable way. And the recommended way to use JSTL is to use the Expression Language (EL).
However, using EL is not a good idea at all. Contrary to Java and plain JSP, EL lacks static typing. This means that many errors which the compiler can catch is not detected until runtime when using EL.
23 April 2009
java -classpath *.jar
It’s quite annoying that you cannot use wildcards in the -classpath command line option to java and javac. Quite often you want to include all .jar files in one directory.
Here is a way to get that effect:
java -classpath `echo lib/*.jar | sed -e “s/ /:/g”` org.foo.MyApp
You can even include all .jar files in a whole hierarchy of directories:
java -classpath `find repository -name *.jar -printf %p:` org.foo.MyApp