Hi, I'm brand new to Spring/Spring Web MVC/MVC in general and I'm trying to figure out how to best design a Controller that returns a View which lists records that can be filtered by type. There is a form on the page that has checkboxes to control what filters are applied. I'd like to use a GET form so that users can bookmark their filtered results:
Something like the following (syntax might be wrong, but hopefully you get the idea):
When you use method="POST", it seems like spring sets the command object with the correct user values and puts it in a request attribute. However, this doesn't seem to happen when the method is GET. Is there a better way of handling a user's form submission than parsing the request parameters using request.getParameter() and hard coding the instantiation of a new model attribute?Code:<form:form method="GET" action="/movies" command="movies"> <form:checkbox path="action" /> Action <form:checkbox path="horror" /> Horror </form:form> <ul id="resultingMovieList">...</ul>
Sorry if this is a dumb question or makes no sense, I can't seem to find any good examples that use method="GET" on spring forms.
(P.S., I'm limited to using Spring 2.5)


Reply With Quote
