类 ViewRendererServlet
- java.lang.Object
- javax.servlet.GenericServlet
- javax.servlet.http.HttpServlet
- org.springframework.web.servlet.ViewRendererServlet
- 所有已实现的接口:
Serializable
,Servlet
,ServletConfig
public class ViewRendererServlet extends HttpServlet
ViewRendererServlet is a bridge servlet, mainly for the Portlet MVC support.For usage with Portlets, this Servlet is necessary to force the portlet container to convert the PortletRequest to a ServletRequest, which it has to do when including a resource via the PortletRequestDispatcher. This allows for reuse of the entire Servlet-based View support even in a Portlet environment.
The actual mapping of the bridge servlet is configurable in the DispatcherPortlet, via a "viewRendererUrl" property. The default is "/WEB-INF/servlet/view", which is just available for internal resource dispatching.
- 从以下版本开始:
- 2.0
- 作者:
- William G. Thompson, Jr., John A. Lewis, Juergen Hoeller
- 另请参阅:
- 序列化表格
字段概要
字段 修饰符和类型 字段 说明 static String
MODEL_ATTRIBUTE
Name of request attribute that holds the model Mapstatic String
VIEW_ATTRIBUTE
Name of request attribute that holds the View objectstatic String
WEB_APPLICATION_CONTEXT_ATTRIBUTE
Request attribute to hold current web application context.
构造器概要
构造器 构造器 说明 ViewRendererServlet()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
doGet(HttpServletRequest request, HttpServletResponse response)
protected void
doPost(HttpServletRequest request, HttpServletResponse response)
protected void
processRequest(HttpServletRequest request, HttpServletResponse response)
Process this request, handling exceptions.protected void
renderView(HttpServletRequest request, HttpServletResponse response)
Retrieve the View instance and model Map to render and trigger actual rendering.从类继承的方法 javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
从类继承的方法 javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
字段详细资料
WEB_APPLICATION_CONTEXT_ATTRIBUTE
public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE
Request attribute to hold current web application context. Otherwise only the global web app context is obtainable by tags etc.
VIEW_ATTRIBUTE
public static final String VIEW_ATTRIBUTE
Name of request attribute that holds the View object
MODEL_ATTRIBUTE
public static final String MODEL_ATTRIBUTE
Name of request attribute that holds the model Map
构造器详细资料
ViewRendererServlet
public ViewRendererServlet()
方法详细资料
doGet
protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- 覆盖:
doGet
在类中HttpServlet
- 抛出:
ServletException
IOException
doPost
protected final void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- 覆盖:
doPost
在类中HttpServlet
- 抛出:
ServletException
IOException
processRequest
protected final void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
Process this request, handling exceptions. The actually event handling is performed by the abstractrenderView()
template method.
renderView
protected void renderView(HttpServletRequest request, HttpServletResponse response) throws Exception
Retrieve the View instance and model Map to render and trigger actual rendering.- 参数:
request
- current HTTP requestresponse
- current HTTP response- 抛出:
Exception
- in case of any kind of processing failure- 另请参阅:
View.render(java.util.Map<java.lang.String, ?>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)