Announcement Announcement Module
Collapse
No announcement yet.
Design suggest..... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Design suggest.....

    In writing a jsp for visualize a list of "messages". When a user
    click on message, a detailed page (or other action) is show.

    What's the best choice for controller?

    I want to minimize controller class.

    I trivial solution it could be write two controller (implements Controller),
    the first one load a list of message and the second one perform the
    custom action on selected message, retrieving idMessage from
    request.

    I think that this IS NOT the right way. I'm switching my WEB layer from
    Strust to Spring MVC and I think that is not a Spring MVC philosophy
    use the request (or session) by hand.

    Thanks.

    Gianni Antini
    Florence - ITALY

  • #2
    I am not sure I would use the ters "right and wrong"

    I personally tend to prefer very fine grained objects, so I would indeed have a controller backing /list.htm and a controller backing /view.htm (or whatever), but others would suggest using a MultiActionController. Some would even suggest using a single Controller with a lot of switch logic, but that *is* wrong

    Bottom line; up to you, but I like keeping controllers doing a single thing, i.e. viewing the list of messages, or rendering a single message....

    Comment

    Working...
    X