|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.AbstractUrlBasedView
org.springframework.web.servlet.view.InternalResourceView
org.springframework.web.servlet.view.JstlView
org.randomcoder.springmvc.JstlTemplateView
public class JstlTemplateView
Custom JSTL-based template view.
Copyright (c) 2006, Craig Condit. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
| Field Summary |
|---|
| Fields inherited from class org.springframework.web.servlet.view.AbstractView |
|---|
DEFAULT_CONTENT_TYPE |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
JstlTemplateView()
|
|
| Method Summary | |
|---|---|
protected void |
exposeHelpers(HttpServletRequest request)
Adds the template map to the request attribute named by setTemplateName(String). |
protected String |
getTemplateName()
Gets the request attribute to store the template map under. |
String |
getUrl()
Gets the URL associated with this view. |
protected void |
populateTemplateMap(Map<String,Object> templateMap)
Populates the given template map with attributes for this template. |
void |
setAttributes(Map<String,Object> attributes)
Sets the attributes to add to this template. |
void |
setParent(JstlTemplateView parent)
Sets the parent template of this template. |
void |
setTemplateName(String templateName)
Sets the name of the request attribute to populate with the template map. |
void |
setUrl(String url)
Sets the URL for this view. |
| Methods inherited from class org.springframework.web.servlet.view.JstlView |
|---|
initApplicationContext |
| Methods inherited from class org.springframework.web.servlet.view.InternalResourceView |
|---|
exposeForwardRequestAttributes, prepareForRendering, renderMergedOutputModel, setAlwaysInclude, useInclude |
| Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView |
|---|
afterPropertiesSet, toString |
| Methods inherited from class org.springframework.web.servlet.view.AbstractView |
|---|
addStaticAttribute, createRequestContext, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
|---|
getServletContext, getTempDir, getWebApplicationContext, isContextRequired, setServletContext |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JstlTemplateView()
| Method Detail |
|---|
public void setAttributes(Map<String,Object> attributes)
attributes - map of attribute key/value pairs.public String getUrl()
Delegates to the parent view if no url was specified.
getUrl in class AbstractUrlBasedViewpublic void setUrl(String url)
setUrl in class AbstractUrlBasedViewurl - urlpublic void setTemplateName(String templateName)
templateName - template name (defaults to "template")public void setParent(JstlTemplateView parent)
Several methods in this class delegate to the parent.
parent - parent template
protected void exposeHelpers(HttpServletRequest request)
throws Exception
setTemplateName(String).
exposeHelpers in class JstlViewrequest - HTTP request
Exception - if an error occursprotected void populateTemplateMap(Map<String,Object> templateMap)
This method merges the template map with that of the parent view if it is found.
templateMap - map of key / value pairsprotected String getTemplateName()
This method delegates to the parent template if no name is found.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||