[ajug-members] Spring MVC question

Igor Tovstopyat-Nelip igor.tn at gmail.com
Tue Jul 3 12:02:42 EDT 2007


Thank you all for clarification! The code for
AbstractController.handleRequest() makes it pretty obvious. And, thanks for
the advise, I will surely join springframework forum.

Cheers,
Igor

On 7/3/07, Kerry Wilson <kwilson at wmsco.com> wrote:
>
> It is my understanding that you do not override handleRequest method
> when extending AbstractController, implement handleRequestInternal.
>
> handleRequest method provides supported method and session
> synchronization functionalities.
>
> source:
>
>   136   public final ModelAndView handleRequest(HttpServletRequest
> request, HttpServletResponse response)
>   137                   throws Exception {
>   138
>   139           // Delegate to WebContentGenerator for checking and
> preparing.
>   140           checkAndPrepare(request, response, this instanceof
> LastModified);
>   141
>   142           // Execute handleRequestInternal in synchronized block if
> required.
>   143           if (this.synchronizeOnSession) {
>   144                   HttpSession session = request.getSession(false);
>   145                   if (session != null) {
>   146                           Object mutex = WebUtils.getSessionMutex
> (session);
>   147                           synchronized (mutex) {
>   148                                   return
> handleRequestInternal(request, response);
>   149                           }
>   150                   }
>   151           }
>   152
>   153           return handleRequestInternal(request, response);
>   154   }
>
>
> if you don't need these functionalities just implement controller.
>
> kw
>
>
>
> Igor Tovstopyat-Nelip wrote:
> > Hi all,
> >
> > I've got a basic Spring MVC question.
> >
> > Interface Controller exposes the public method handleRequest() which
> > is supposed to be implemented by any custom controller. This is the
> > main method for Spring MVC from which you hook up to the application
> > service layer.
> >
> > On another hand, the class AbstractController, which is recommended to
> > use for handling GET type requests, exposes an additional method
> > handleRequestInternal() with exactly the same signature. So,
> > AbstractController and any class derived from it end up with these two
> > methods: handleRequest() and handleRequestInternal().
> >
> > Why this additional method is needed and why it should be used instead
> > of the normal handleRequest() method?
> >
> > Thank you,
> > Igor
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ajug-members mailing list
> > ajug-members at ajug.org
> > http://www.ajug.org/mailman/listinfo/ajug-members
> >
>
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20070703/bf0094f3/attachment.html 


More information about the ajug-members mailing list