Skip to main content

Posts

Showing posts from December, 2011

Colorify your Eclipse

Yesterday, while I was watching a video about the Play! framework, I realized that I was contemplating TextMate's colors. So, after some googlings, I discovered a "color plugin" which changes the text theme (it doesn't concern the overall look and feel but just the text apparence here). It is so nice so I put here the update-site url :
http://eclipse-color-theme.github.com/update

Spring saved my day on an UTF-8 encoding problem

I'm working on Jasig CAS (an SSO server) and I had an issue with special chars. For example, it was impossible to log in with a password like &é"'(-.
I checked my jsp file :it was encoded in UTF-8I checked the encoding directive (<%@ page contentType="text/html; charset=UTF-8" %>) : OKThe idea was to force the request encoding with something like :

request.setCharacterEncoding("UTF-8");

But I was in Spring MVC and I didn't want an ugly hack. Fortunately, Spring saved my day with a builtin servlet filter to declare in the web.xml.

<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>
<par…