Archive for the ‘Uncategorized’ Category

A Google Wave Account

Monday, July 27th, 2009

Today I got my developer account for the Google Wave platform. Since the demo video looked really cool, I was eager to test this.

I didn’t have a lot of time to test yet, but my first impression is that it is the chaos of a bulletin board, mixed with the trolls found in blog comments and interspersed with unrelated automated bot comments.

Probably this is because I’m jumping right in, and other developers already had info sessions or got in earlier, so they had some time to get used to everything before the place was overwhelmed.

It’s still a developer preview, so I’ll give it some more time before I decide if I really like it…

Varnish

Thursday, October 25th, 2007

My Squid book has arrived, but is it bit disappointing: only one chapter about reverse proxies! Frank told me to have a look at Varnish, so that’s what I’ll do!

Apparently, Varnish isn’t written with 1975 programming and should be much faster

Ee-jay-bee

Tuesday, August 7th, 2007

Something just hit me: why does everyone (in Belgium at least) pronounces EJB as ee-gi-bee? Isn’t a J pronounced as jay, so it should be ee-jay-bee?

Or am I completely missing the point here and should I call it JPA (but is that gi-pi-ay or jay-pi-ay)?

Google Co-op – Custom Search Engine

Wednesday, October 25th, 2006

I just created my own Google search engine specifically targeted to Java web development: Onthoo Java Web Development Search.

It filters Google search results based on some sites that I defined.

The only trick for non-US users is to go to the Google home page and click on “Google in English” in the bottom navigation. Otherwise the search results are not filtered on the sites that I specified.

It’s easy to create your own, so try it!

AOP proxy and inner method invocations

Wednesday, August 2nd, 2006

When using my aop cache framework, I sometimes saw that methods were not cached although they should. Some further investigation revealed that this only happened when the method was invoked inside the target object itself.

So if you have an object PersonDAO and you invoke PersonDAO#getPerson() on it from another object, the method is proxied. But if you have a method PersonDAO#getAllPersons() and from there you call this.getPerson(), the method will not be proxied. This is described here in more detail.

The solution I implemented was adding a getThis() method to the affected classes. Not pretty, but it works…

    /**     * When running in an AOP proxy, methods that are called inside the proxy      * are invoked on the target itself, instead of on the aop proxy.  The workaround for      * this is to ask the AopContext for the current proxy and invoke the method there.     *      * See http://opensource.atlassian.com/projects/spring/browse/SPR-2226.     *      * @return the AOP proxy for this object     */    private PersonDAO getThis() {        try {            return (PersonDAO) AopContext.currentProxy();        } catch (AspectException exc) {            logger.error("Not running inside an AOP proxy, so no proxy can be returned: "                     + exc.getMessage());            return this;        }    }

The only thing left to do was to expose the proxy in the proxyCreator, which is not enabled by default. I did this with BeanNameAutoProxyCreator#setExposeProxy(true).

Tomcat 5 and IIS on Windows Server 2003

Friday, July 22nd, 2005

Using the Tomcat connector on IIS on Windows Server 2003 isn’t as straithforward as you think it would be. There is a very detailed guide available which helped me solve the issue.

The important point is that you need to check the “Run WWW service in IIS 5.0 isolation mode option”.

Get rid of <c:out value="${someParam}"/>

Friday, July 15th, 2005

Convinced that jstl is a big improvement on jsp scriptlets? But do you also find your JSPs cluttered with <c:out value=”${someParam}”/>? Here’s something I only recently discovered (why didn’t anyone tell me this before?).

First change web.xml so it begins with the following definitions. You need Tomcat 5 for this to work (or another 2.4 compliant application server).

<?xml version=”1.0″ encoding=”ISO-8859-1″?>

<web-app xmlns=”http://java.sun.com/xml/ns/j2ee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”
version=”2.4″>

Now you can simply use ${someParam} in your jsp, which is of course much cleaner (looks a bit like velocity now) and better suited to hand over to a css designer.

You can still define
<%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core_rt” %>
in the beginning of the jsp if you need to use <c:forEach … /> for example.

CSS Selector fundamentals

Wednesday, July 13th, 2005

As a web developer, you have to know a little bit CSS from time to time. While I do feel comfortable with the basics, there were some special cases that I didn’t quite understood.

I found an article that gives a very good overview of the different CSS selectors that are availabe.

Eclipse Webtools

Wednesday, June 15th, 2005

Eclipse Webtools is a set of plugins which make the life of a web developer simpler. Especially useful (for me) is jsp, xml, css and js syntax coloring and the javascript auto-completion. Also code formatting is available.

The Webtools download page is a bit confusing and I couldn’t get it to work, so I followed a very helpful thread about installing WST on Eclipse 3.1.

Hibernate 3 final

Thursday, April 14th, 2005

- sigh –

Guess I should check hibernate.org every week instead of every month. The trouble I had with antlr yesterday is fixed in this release. Apparently they now use a patched antlr1.7.5H3.jar version of antlr which uses a different class loading mechanism.