Professional Java Development With The Spring Framework [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional Java Development With The Spring Framework [Electronic resources] - نسخه متنی

Rod Johnsonet

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








Handlers and Their Adapters


Handlers are the actual components responsible for executing the logic in your web application, or delegating to another component executing the logic. Handlers should somehow be able to fulfill an incoming request and return an org.springframework.web.servlet.ModelAndView object containing the logical name of a view and the model the view will render. Out of the box, Spring provides two types of handlers.

All handlers that can inspect the HttpServletRequest and modify the HttpServletResponse by themselves derive from the org.springframework.web.servlet.mvc.Controller interface. Most of Spring's handlers are built using this interface.

There's a second type of handler Spring provides, which doesn't depend on the Servlet's request and response objects. This somewhat resembles the approach taken by the WebWork and Maverick web application frameworks, in that the information from the request the user issues is bound to the handler, which in its turn needs to create a ModelAndView and return it. The interface to implement when you like this approach is org.springframework.web.servlet.mvc.throwaway.ThrowAwayController.

We'll cover the different controllers later, together with some scenarios in which they are especially useful.

/ 188