Saturday, August 26, 2006
SVN and CVS eclipse plugins.
Today I have used SVN for the first time and I got mixed feeling about SVN plugin for Eclipse.
Overwall it works ok , however there were couple of things that confused me.
A lot of people claim SVN to be faster, but I really did not feel it. To me it seemed to have no better performance than CVS.
Many times, when integrating other people changes to CVS, I just place updated file over existing and commit. When I tried to do that using eclipse SNV plugin, it marked file as deleted. I needed to open file and use cut-n-paste to replace its content. Seems a little weird to me and CVS is much straightforward in this.
SVN has file locking - this is a good thing, becuase many tims you need to lock a file while working on it and merge really complicate things, rather solves issues. Developers suppose to talk one with each other about changes, but it does not work at times.
My final conclusion that I will need to think if I really want to use SVN instead of CVS.
Overwall it works ok , however there were couple of things that confused me.
A lot of people claim SVN to be faster, but I really did not feel it. To me it seemed to have no better performance than CVS.
Many times, when integrating other people changes to CVS, I just place updated file over existing and commit. When I tried to do that using eclipse SNV plugin, it marked file as deleted. I needed to open file and use cut-n-paste to replace its content. Seems a little weird to me and CVS is much straightforward in this.
SVN has file locking - this is a good thing, becuase many tims you need to lock a file while working on it and merge really complicate things, rather solves issues. Developers suppose to talk one with each other about changes, but it does not work at times.
My final conclusion that I will need to think if I really want to use SVN instead of CVS.
Wednesday, August 23, 2006
Struts error message handling
There is a lot of material written on how to handle error messages with struts, but I would like outline implementation for specific use case that I had to implement today.
Scenario:
There is a form that does some work Once user submit the form, action performed and user redirected back to the initial page with form, displaying either error message in red color or success message in green color.
Message should be displayed only once, and subsequent refresh of the page should not display neither success or error message. No ".do" url should ever appear in address bar
Solution:
Create "success" and "error" message bundles and use 2 different instances of tag to control presentation. Make sure that in the action code either "success" or "error" resources keys are passed, not both. Errors then saved on the session, in order to survive http redirect. jsp page has logic for transering error o
Important Implementation points:
- In this implementation I specifically using session to store errors and use redirect ="true" attribute in action mapping config.
- Due my laziness, I am using FONT tags instead of CSS, but it does the job just fine.
- Errors then saved on the session, in order to survive http redirect.
- Jsp page has logic for transering error object from session to request scope, removing it afterwards. This is needed to display it only once, and avoid displaying messages upond page refresh after action performed.