@Deprecated public abstract class AbstractMixer2XhtmlView extends org.springframework.web.servlet.view.AbstractView
NOTICE: view component scope shuld be "prototype"
implementation sample
@Component
@Scope("prototype")
public class HelloWorldView extends AbstractMixer2XhtmlView {
@Autowired
protected Mixer2Engine mixer2Engine;
@Autowired
protected ResourceLoader resourceLoader;
private String mainTemplate = "classpath:helloWorldTemplate.html";
@Override
protected Html createHtml(Map<String, Object> model,
HttpServletRequest request, HttpServletResponse response)
throws IOException, TagTypeUnmatchException {
// load html template
Html html = mixer2Engine.loadHtmlTemplate(resourceLoader.getResource(
mainTemplate).getInputStream());
Div div = html.getById("message", Div.class);
div.unsetContent();
div.getContent().add(model.get("helloMessage"));
return html;
}
Mixer2XhtmlViewResolver
Constructor and Description |
---|
AbstractMixer2XhtmlView()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Html |
createHtml(Map<String,Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated.
|
String |
getContentType()
Deprecated.
|
String |
getDocType()
Deprecated.
|
Html |
getHtml()
Deprecated.
|
Locale |
getLocale()
Deprecated.
|
Mixer2Engine |
getMixer2Engine()
Deprecated.
|
protected void |
renderMergedOutputModel(Map<String,Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated.
|
void |
setContentType(String contentType)
Deprecated.
|
void |
setDocType(String docType)
Deprecated.
|
void |
setHtml(Html html)
Deprecated.
|
void |
setLocale(Locale locale)
Deprecated.
|
void |
setMixer2Engine(Mixer2Engine mixer2Engine)
Deprecated.
|
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
protected abstract Html createHtml(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Exception
protected void renderMergedOutputModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
renderMergedOutputModel
in class org.springframework.web.servlet.view.AbstractView
Exception
public String getDocType()
public void setDocType(String docType)
public String getContentType()
getContentType
in interface org.springframework.web.servlet.View
getContentType
in class org.springframework.web.servlet.view.AbstractView
public void setContentType(String contentType)
setContentType
in class org.springframework.web.servlet.view.AbstractView
public Html getHtml()
public void setHtml(Html html)
public Mixer2Engine getMixer2Engine()
public void setMixer2Engine(Mixer2Engine mixer2Engine)
public void setLocale(Locale locale)
public Locale getLocale()
Copyright © 2021 Project Mixer2. All rights reserved.