PDA

View Full Version : A plan for implementing our web apps with Spring


jstull
Aug 30th, 2004, 02:57 PM
Hello,

I'm in the process of examining alternatives to Struts in a large public sector app development environment. I am extremely impressed with Spring's IOC approach to glueing the MVC together (something I have had to handle by myself in the past with Struts).

I'm looking for some advice on a good View to Controller to Model to View strategy that will gracefully handle domain concepts with multiple levels of dependency, form field validation, business rules validation, and error handling. Specifically could someone recommend a particular Spring Controller, Command Controller, Handler Mapping, Handler Interceptor usage strategy?

Struts is so inflexible that I didn't have to deal with many choices! If this is too vague, let me know. I guess I'm just looking for some folks' experiences with wiring together a Spring based app.

My Thanks,
j

katentim
Sep 6th, 2004, 06:54 AM
It depends on your needs. I'd recommend looking at the Spring samples and try a few. JPetstore has samples in Struts and Spring MVC for comparison.

I've used SimpleUrlHandlerMapping in combination with SimpleFormController for several types of forms (add/edit) and MultiActionController to handle several 2-3 liner actions (e.g. display list, delete item, etc...). For view - JSP using JSTL is a good choice - again see Spring samples.

Re: Validation
The great thing with Spring MVC (unlike Struts) is that you validation is not dependent on the framework or Servlet API (i.e. you can test your validation logic outside of the container).