adding cookie after dofilter in glassfish

I tried this glassfish and the repsonse headers didn’t contain any cookie information (tested using LiveHttpHeaders in firefox). I also tried setting the buffer size but that didn’t work either. Then I had move the code to before ‘doFilter’ and it worked. Wierd..glassfish doesn’t even throw an error if it failed to set cookies. Probably a bug with the server. I didn’t try with response wrapper.

strange behavious with struts 2 validators

The int validator only checks for the range. It doesn’t case if the input is a valid integer or not. Better use a ‘regex’ validator for checking if it is number. And then use ‘int’ validator to make sure the number is with in the range.

The regex validator on integer field doesn’t work for some reason (this is because it expects the field to be validated by the conversionError interceptor).

Hot swap debugging with glassfish

Most often I get this error : ‘Scheme change not implemented’ even though I didn’t do much other than adding a sysout statement. Here is the troubleshooter for that:
1. Make sure the appserver, eclipse ant, project jre in eclipse all point to same
2. Make sure the filesync plugin doesn’t copy the class files to web-inf/classes directory. Instead you could set your eclipse build directory to web-inf/classes.

And if these things don’t solve your problems, check this out: