Tuesday, December 02, 2008
I love the simpsons, and i felt the Apple love and hate...
Posted by
Thomas Heute
at
8:50 PM
0
comments
Thursday, July 31, 2008
Servlet filter doesn't work, or does it ?
It has been a while I found the time to blog. Here is a little entry.
I've often hear that a Servlet filter was not working while trying to filter some Java resource. Usually this is because the filter is defined like:
<filter-mapping>
<filter-name>My Broken Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
and the filtered content is accessed through request dispatching.
This look correct, but this is not. In the 2.4 version of the Servlet spec you can now filter resources accessed directly from the request, through an include request dispatcher, through a forward request dispatch or through the error mechanism of the spec.
By default, if nothing is specified, the filter will only apply to direct requests. This is the case here and this is what confuses people.
If you want to filter request coming from an include request dispatcher you need to add: <dispatcher>INCLUDE</dispatcher>
Here are few examples:
The following will only filter direct requests:
<filter-mapping>
<filter-name>My Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The following will only filter direct requests too:
<filter-mapping>
<filter-name>My Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
The following will only filter direct requests and inclusions:
<filter-mapping>
<filter-name>My Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
The following will only filter inclusions:
<filter-mapping>
<filter-name>My Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
The following will filter all:
<filter-mapping>
<filter-name>My Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
Want more ? Check the servlet spec, "SRV.6.2.5 Filters and the RequestDispatcher"
Posted by
Thomas Heute
at
10:43 AM
5
comments
Labels: Java
Friday, May 09, 2008
Yamaha fz6 Fazer ABS, It's here !
Posted by
Thomas Heute
at
6:44 PM
1 comments
Labels: Moto, Simple life
Monday, April 21, 2008
Oracle DB, you suck !
As I'm working on a multiple supported database application, most of the issues i faced are because of Oracle Database...
Point 1 - The official jdbc driver sucks.
Since i write in Java, i need to go through the JDBC driver to access the Oracle Database server, while it should be transparent and a fairly easy piece of software to maintain, they do an horrible job... Let's consider a moment that Oracle DB server is the best database server in the world, going through it with their JDBC driver is just pure abomination... It's like driving a Porsche with a loose steering wheel, i would rather drive a Renault then.
Point 2 - Empty string is not NULL !
Oracle DB is the only database that i know considering "" (Empty string) as NULL. This is plain stupid.
Let's say you want to enter a value which can be empty or undefined, well you can't... (unless you have a special string that means undefined).
Those are the two main points I'm thinking about at the moment.
Posted by
Thomas Heute
at
12:56 PM
12
comments
Labels: Java
Friday, April 11, 2008
Mid-life crisis
I just realized that i have some symptoms of Mid-life crisis.
I'm literally changing many things in my life right now, and want to do lot of new things.
First i'm buying my very first house up in the mountains. Second i'm getting married next year. (Chronological order)
Now I regret i didn't pursue on skydiving but will do my first paragliding fly this year !
Also, if you would have asked me about motorbike riding 3 weeks ago, i would have tell you this is something for people willing to die and wanting to show-off. For the past two weeks, i just kept thinking about riding a motorbike to come from my house to the office... And i don't want to die, neither i want to show off. I want to learn something new, i'm very excited about learning that. (I still need to find some money and a place to park...)
Anyway what scares me now is that it looks like a mid-life crisis. Nobody really teached me how that works, but since i just turned 30 last November, does that mean i only have 30 more years to live ? I've been told that there is a one-third-life crisis too, i hope that's it.
Posted by
Thomas Heute
at
2:59 PM
0
comments
Labels: Simple life
Tuesday, March 25, 2008
Why you should jailbreak your iPhone

I finally took some time to check why my cookies were not saved on the iPhone embedded Safari. It appears that it's a bug that came with the 1.1.4 firmware, a stupid write permission missing, something that takes few seconds to fix on an open platform.
Unfortunately the iPhone is a closed platform if you don't do anything and you can't fix that bug yourself, you need to wait on Apple to get a new version of the firmware. Not everybody is affected by this bug so i don't know the whole story behind, what i know is that when you have that bug it's very annoying.
Anyway, i was always wondering if i would jailbreak it (open it, against the will of Apple) if i had an iPhone the "standard way", the answer is "hell no" i can't live with bugs if i know that it would be easy to fix after opening it.
(Now we could wonder why buying a closed platform at all, well just because it's a well done gadget)
Posted by
Thomas Heute
at
6:44 PM
0
comments
Labels: Fun, Simple life, Technology
Monday, February 25, 2008
How to "propose" thanks to Facebook

If you are not so romantic or very shy, you can always propose your beloved through Facebook.
See, if you change a friend status to "engaged" it says "A notification will now be sent to xxx yyy for approval".
Just wait and you'll know if he/she says "Yes" !
By the way, this blog entry is also a good way to let you know that she said "yes" (in real, not on Facebook yet though).
Posted by
Thomas Heute
at
1:26 PM
8
comments
Labels: Fun, Simple life