Class ModelAndViewBridge
java.lang.Object
net.officefloor.spring.starter.rest.ModelAndViewBridge
Bridge to Spring for the
ModelAndView.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHandlerMethodfor OfficeFloor bridging. -
Constructor Summary
ConstructorsConstructorDescriptionModelAndViewBridge(Method method, org.springframework.web.method.support.ModelAndViewContainer modelAndViewContainer, Object handler, org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter handlerAdapter, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.servlet.DispatcherServlet dispatcherServlet, org.springframework.context.ApplicationContext applicationContext) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.context.ApplicationContextObtains theApplicationContext.org.springframework.web.servlet.DispatcherServletObtains theDispatcherServlet.org.springframework.web.method.HandlerMethodObtains theHandlerMethod.jakarta.servlet.http.HttpServletRequestObtains theHttpServletRequest.jakarta.servlet.http.HttpServletResponseObtains theHttpServletResponse.org.springframework.web.servlet.ModelAndViewgetModelAndView(String view) Obtains theModelAndViewfrom the current state.org.springframework.web.method.support.ModelAndViewContainerObtains theModelAndViewContainer.org.springframework.web.method.annotation.ModelFactoryObtains theModelFactory.org.springframework.web.context.request.NativeWebRequestObtains theNativeWebRequest.org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapterObtains theRequestMappingHandlerAdapter.org.springframework.web.bind.support.WebDataBinderFactoryObtains theWebDataBinderFactory.voidprocessDispatchResult(org.springframework.web.servlet.ModelAndView modelAndView, Throwable ex) Delegates to theDispatcherServletto process the results.voidwriteObjectResponse(Object returnValue) Writes the return value.
-
Constructor Details
-
ModelAndViewBridge
public ModelAndViewBridge(Method method, org.springframework.web.method.support.ModelAndViewContainer modelAndViewContainer, Object handler, org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter handlerAdapter, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.servlet.DispatcherServlet dispatcherServlet, org.springframework.context.ApplicationContext applicationContext) throws Exception Instantiate.- Parameters:
method-Methodbeing bridged.modelAndViewContainer-ModelAndViewContainer.handler- Handler object.handlerAdapter-RequestMappingHandlerAdapter.servletRequest-HttpServletRequest.servletResponse-HttpServletResponse.webRequest-NativeWebRequest.dispatcherServlet-DispatcherServlet.applicationContext-ApplicationContext.- Throws:
Exception- If fails to create the bridge.
-
-
Method Details
-
getModelAndViewContainer
public org.springframework.web.method.support.ModelAndViewContainer getModelAndViewContainer()Obtains theModelAndViewContainer.- Returns:
ModelAndViewContainer.
-
getHandlerMethod
public org.springframework.web.method.HandlerMethod getHandlerMethod()Obtains theHandlerMethod.- Returns:
HandlerMethod.
-
getRequestMappingHandlerAdapter
public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter getRequestMappingHandlerAdapter()Obtains theRequestMappingHandlerAdapter.- Returns:
RequestMappingHandlerAdapter.
-
getWebDataBinderFactory
public org.springframework.web.bind.support.WebDataBinderFactory getWebDataBinderFactory() throws ExceptionObtains theWebDataBinderFactory.- Returns:
WebDataBinderFactory.- Throws:
Exception- If fails to obtain theWebDataBinderFactory.
-
getModelFactory
Obtains theModelFactory.- Returns:
ModelFactory.- Throws:
Exception- If fails to obtain theModelFactory.
-
getHttpServletRequest
public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()Obtains theHttpServletRequest.- Returns:
HttpServletRequest.
-
getHttpServletResponse
public jakarta.servlet.http.HttpServletResponse getHttpServletResponse()Obtains theHttpServletResponse.- Returns:
HttpServletResponse.
-
getNativeWebRequest
public org.springframework.web.context.request.NativeWebRequest getNativeWebRequest()Obtains theNativeWebRequest.- Returns:
NativeWebRequest.
-
getDispatcherServlet
public org.springframework.web.servlet.DispatcherServlet getDispatcherServlet()Obtains theDispatcherServlet.- Returns:
DispatcherServlet.
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()Obtains theApplicationContext.- Returns:
ApplicationContext.
-
writeObjectResponse
Writes the return value.- Parameters:
returnValue- Return value.- Throws:
Exception- If fails to write the return value.
-
getModelAndView
Obtains theModelAndViewfrom the current state.- Parameters:
view- Name of the view.- Returns:
ModelAndViewfrom the current state.- Throws:
Exception- If fails to obtain theModelAndView.
-
processDispatchResult
public void processDispatchResult(org.springframework.web.servlet.ModelAndView modelAndView, Throwable ex) throws Exception Delegates to theDispatcherServletto process the results.
-