Category Archives: Development

Calling methods with parameters using JSTL

I was quite annoyed by the fact that you can’t just call a method with certain parameters using JSTL. Lucky me, google gave me a result where I could see how this is done (using JSP 2.0).

The thing is, you need to create a static method with the required parameters and then you need to define a TLD to be able to call the function. This process can probably be simplified by using a tool like XDoclet so your TLD is generated automatically, but I didn’t look into that, yet.

Another way to do it is described by Lucas Jellema on the AMIS blog. But I don’t call this a real solution, just a very dirty hack. I respect him for his posts on Oracle, but I don’t like this solution at all.

svn move multiple directories with confirm

I had to rearrange multiple directories, but not all, in a svn tree to make a project more compatible with Eclipse. For this I used the following one-liner so I could do this more easily.

for file in `find -maxdepth 1 -type d`; do \
echo -n $file "[y/n] "; \
read -n 1 shouldMove ; \
if [ "$shouldMove" == "y" ]; \
then \
svn mv `basename $file` WebContent/`basename $file`; \
fi; \
done

This way I was sure all directories I wanted to move were moved (since a svn mv does not remove the directory right away, it does that on commit).