Archive for the ‘webdevelopment’ Category

GWT and IE: operation aborted

Wednesday, September 19th, 2007

I got an “operation aborted” error in Internet Explorer 7, which rendered half of the page and then showed an empty page. Needless to say that everything worked perfectly in Firefox.

Even stranger was that I finally managed to fix it, but when I added Google Adsense banners, I got the error again!

After some googling and frustrating (un)commenting of blocks of code, I finally moved all javascript imports (GWT and Google Analytics) to the end of the page (just before the closing body tag). And – woohoo!- everything works!

Thanks to this overview of the problem!

Spring sample project

Monday, April 2nd, 2007

I found a nice (and small) Spring sample project on the Interface21 Team Blog.

I learned about @NotNull annotations and how to define/process them in the applicationContext.xml. Also, this is an interesting remark I found about registering PropertyEditors:

The JavaBeans package uses a small little convention to resolve property editors. If a conversion is needed for a specific class, the JavaBeans package searches (amongst other) for a class in the same package named after the to be converted class, appended with ‘Editor’. Therefore, the CarModelEditor does NOT have to be registered; it’s found automatically!

I suggest you download the code and have a look at the xml and java files.

Webwerkers Blog

Monday, March 26th, 2007

Samen met Frank (een collega van mijn “The Reference” periode) en enkele andere collega’s is het de bedoeling om een blog voor “webwerkers” bij te houden. Mijn eerste post over HTML optimalisaties staat er al!

Comments in XHTML Strict

Sunday, February 11th, 2007

I just spent way to much time trying to find a fix for a CSS problem in Internet Explorer 7. Finally, I discovered that everything was fixed as soon as I removed a html comment from the beginning of the page.

So I changed
<!– Start page –>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>

to
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>

And all of a sudden, everything looks exactly as intended (and designed in Firefox).

I tried a lot of fixes, from checking javascript solutions to the Holy Grail.

Now I still have conditional comments, but this is something I can live with.

PCTV version 2

Monday, January 23rd, 2006

Version 2 of Telenet PCTV has been released today (if you’ve read my other posts, you understand what a busy time I’ve had lately). Main new features are:

More exciting new features are coming, so stay tuned!

Telemeter

Monday, January 16th, 2006

The new Telenet Telemeter was released this weekend. Telenet is one of the two greatest Belgian cable providers. The telemeter is a tool where you can view how much data you have uploaded and downloaded. It is also possible to specify if (and when) you want to get an e-mail or a webpage when you have reached for example 80% of the monthly volume that you can download.

This project interfaces with the Telenet backend by using Hessian (we first used Axis, but since both application are written in Java, we decided to switch to Hessian in order to have a performance gain). The switch from Axis to Hessian was simply a matter of switching Spring configuration, which again indicates the cleverness of the Spring framework.

The application displays some charts. After a rather negative experience with jFreeChart and CeWolf, we decided to use FusionCharts, a flash application which uses XML to render the graphs. This choice has a lot of benefits:

  • The XML is very easy to understand and generate
  • Load is moved from the server to the client
  • It’s easy to switch layout and graph type
  • The graph can contain a lot of useful information without using huge html imagemaps
  • The graphs can use animation, which give a wow-effect to the end-user

The telemeter now runs very fast (considering what happens behind the scenes) on a WebLogic cluster, but had some initial load problems because of another application that was running on the same server that crashed it.

It is sometimes humorous to read the post on the Telenet user forums, where a lot of people (mostly teenagers have nothing else to do besides downloading movies from newsgroups and complaining about the data limits) report errors which most of the time are just because of their misunderstanding of the application.

I myself am convinced that the data limits are needed so the network stays fast for everyone and isn’t slowed down because some guys want to watch illegal low quality movies. But, of course, this is my own humble feeling about it.

CM Site

Monday, January 9th, 2006

Today the new CM site went live. I the role I played in this project was limited to optimisation of the database code (Hibernate tuning) and some small Java development. The site runs on Tridion and Oracle Application Server.

One piece I’m particularly proud of is the selection of postal codes and cities. You can try it out here. It suggest possible cities while you type, and supports both mouse and keyboard navigation. There is also a fallback on the server when the browser doesn’t support (certain parts of) javascript.

Instead of cluttering the html with javascript, I wrote a .js file which registers methods like ‘onmouseover’ and ‘onchange’ to objects in the HTML DOM when loading the page. There was an issue with Internet Explorer which leaks memory when using this, so I needed a “shutdown” method which deregisters these callbacks when the user navigates to another page.

I didn’t use ajax for this because it would generate to much load on the server to get city name suggestions for every letter that is typed and because the data is rather limited.

You can browse the source of the page and look for yourself how this all works.

CharacterEncodingFilter

Friday, July 22nd, 2005

Almost daily I discover a hidden gem inside the Spring support classes. org.springframework.web.filter.CharacterEncodingFilter is one of them. The important code is only 3 lines, but it is very useful for localized applications.

It sets the character encoding of the request, which is often needed because most most browsers don’t specify it. It was the solution to our problem where we got strange characters instead of the correct ones (é, è and so on …).

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>

Also useful to know is that this class uses the OncePerRequestFilter which is a subclass of GenericFilterBean. These classes are very good base classes for the javax.servlet.Filter interface.

If you haven’t looked at the Spring source code already, you should do this as soon as possible and check this out. The javadoc is very clear, but I learned a lot by looking at how the Spring guys do it.

Ajax (Advanced Javascript and XML)

Monday, May 2nd, 2005

I create a simple search page with the aid of some helper classes for Lucene integration in Spring and an Ajax implementation.

Ajax enables HTML to be changed with server data without the need to refresh the html or complex scripting.

The result is pretty neat: while typing, the search results are already displayed so it is easier to find something. For standard HTML sites this is probably overkill, but for the upcoming Media Center sites where a user has only a remote control available, this is quite useful.

The DWR library is surprisingly easy to use and very complete, thanks to the guys from Getahead.