public class JFinalView
extends org.springframework.web.servlet.view.AbstractTemplateView
关键设置: 1:setContentType("text/html;charset=UTF-8") 设置 content type 字符集为 UTF-8 2:setExposeRequestAttributes(true) 设置将 request 中的属性值注入到 model 中去 便于在模板中使用 #(value) 访问 request.setAttribute(...) 进去的值 3: setExposeSessionAttributes(true) 设置将 session 中的属性值注入到 model 中去 使用在模板中使用 #(value) 访问 session.setAttribute(...) 进去的值 注意:JFinalViewResolver.setSessionInView(true) 中的配置与 JFinalView.setExposeSessionAttributes(true) 可实现 相似的功能,区别在于前者访问方式为 #(session.value) 而后者为 #(value),两种配置只选其一
Modifier and Type | Class and Description |
---|---|
static class |
JFinalView.InnerSession |
Constructor and Description |
---|
JFinalView() |
Modifier and Type | Method and Description |
---|---|
protected void |
renderMergedTemplateModel(Map<String,Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
protected void renderMergedTemplateModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
renderMergedTemplateModel
in class org.springframework.web.servlet.view.AbstractTemplateView
Exception
Copyright © 2018. All rights reserved.