A servlet reading cookie??

Case: write a cookie using for example with javascript. Now normally if you have an array of id’s you would just write them plain and simple in the cookie using an array to string respresentation. This is all good…. but if the array to string method is using a comma to seperate the elements there is a problem if you want to use the getCookies method in de javax.servlet.http.HttpServletRequest class of java. It somehow thinks it needs to read every comma seperated element into a different cookie, so what you get is a boogus result. So instead of using comma seperated elements, try using dots or some other sign ;)..

Struts vs. Spring mvc

Last week i was working on a new project which involved using a java mvc framework. I’ve been working with struts mvc for over 2 year now, so i pretty know the ins an outs of this framework. Ofcourse you always have to keep an eye open for new things to arrive and since it is pretty much clear that we were going to use some other features of the spring birds nest , i thought lets use it’s mvc as well. Now this turned out to be a bit of a disappointment. It seems that the things you might hate about struts are actually very easy for use. For example the way struts uses tiles is somewhat verbose but it works. With the spring mvc there is a option to use tiles but the description is about 10 lines of text so a bit fragile to use in a commercial environment. Also the way they created controllers is a bit freaky. In struts you get the whole package, a form, a view, a method(action) based controller. Now with Spring they use a different approach, they have a form, a action, a command and many other controllers. But all you want is to do it all in once. I have to say that i might change my mind, because i’ve only been testing the spring mvc for a small week now……