views:

93

answers:

1

I am following the spring MVC tutorial and also reading this article on mvc design patterns http://www.javaranch.com/journal/200603/frontman.html

Hence I am trying to make an app with like this, that make use of spring mvc structures and frontController design pattern. 1. frontController with the DispatcherServlet from spring, that redirect and handles requests as setup by routing in the (servlet_name)-servlet.xml 2. setup some business logic objects that make up of Beans and TO classes.

some questions there 1. as the dispatchservlet only take one controller for one form action, does it mean i need to implement each action a controller? would there be some more elegant ways? 2. I would also need pointers with setting up a security filter for authentication for all pages

+1  A: 

Don't forget about a separate service layer.

  1. as the dispatchservlet only take one controller for one form action, does it mean i need to implement each action a controller? would there be some more elegant ways?

You can associate an action with a Controller method, so if there are several actions that make sense to group into a single Controller you can feel free to do it. Check out the annotations in Spring 3.

  1. I would also need pointers with setting up a security filter for authentication for all pages

You can do basic auth or, better yet, use Spring Security.

duffymo
i am thinking i am confused with controller and beans. each of beans used to be associated with one page. but there are also page beans, session beans or app beans. were grouping of controller actions a spring 3 feature? can i do so in spring 2?i am asking so because i could not find a tutorial that guide me starting with spring 3. and i failed to find the dispatcher servlet when using the old tutorial
nokheat
also what is meant by a separate service layer?
nokheat
The Spring MVC step by step is close enough, and the DispatcherServlet has been part of Spring MVC since 1.0. All the tutorials use it. You don't modify or extend it, you just configure it and forget it.
duffymo
If you were following along with Spring you'd know what I meant: http://blog.springsource.com/2009/12/21/mvc-simplifications-in-spring-3-0/
duffymo
so i could just do the same thing in spring mvc tutorial and it will start kicking?
nokheat
i found that it got to do with the dependent libraries.in spring 3, they are no longer packed under lib/ directory and it causing me some trouble.
nokheat