Jul 15th, 2009, 01:08 PM
Is it a good idea to use spring jsp tags at all?
Spring provides custom tag libraries for jsp templates (e.g. form:form)
In my organization, we try to follow the practice of keeping the view (the jsps) completely independent of any MVC technology. The advantage of this loose coupling is that we can potentially change the MVC framework later as required without impacting the views. JSTL + JSP EL 2.0 is OK to use.
My questions :
Has anyone tried to use Spring MVC in a reasonably large environment (around 500+ projects) without being tied down to spring tag libraries? If yes, are there established patterns for do so? For e.g. what would be the best way to carry out form validation (and parameter binding) without depending on the form:form tag? (That was just an example to give you an idea of what's in my mind)
EDIT: We are currently using Struts and are evaluating the possibility of using either one of Spring MVC or Struts2 or JSF. If we lose out a significant portion of Spring MVC's power just due to the inability of using custom Spring tags, that will be an unfortunate reason to not use Spring MVC
Last edited by debarshim; Jul 15th, 2009 at 01:11 PM.
Jul 15th, 2009, 02:54 PM
Guess this is the question we're all evaluating.
Keep the code free of unnecessary imports, and decoupled as much as you can. The ultimate smell test is whether you have redundant code (i.e. you repeat the same code several places around your applications).
Use includes or some sort of templating technology (like Facelets or the like) in your frontend xhtml code.
My personal opinion is that it's best to stick to widely used frameworks. There are several benefits: It is easy to recruit people, easy to google for help, lots of courses around, and a lot of fixed bugs. However, on the other hand, you should also try to do a few experiments with exotic view technologies (like GWT or Wicket) to see if you can improve development speed and/or quality by using a few ideas or technologies from the shelf. As long as you keep your dependencies clean across the different levels of your application, switching view technology doesn't change the backend code or business logic. (Think IoC!)
At the moment we're using JSF with RichFaces on our frontend. Of course it takes some energy if we want to change technology, but it might be possible to wrap most of the frontend code (backing beans) to make the switch easier. However, it also complicates things a bit, unless you have some really nice and logical class interfaces or wrapper classes.
Note: As to what I've heard, Struts2 should be dead and succeeded with something better. (Don't have any references right here though...)
Tags for this Thread