public class JasperReportsViewResolver extends UrlBasedViewResolver
ViewResolver
implementation that
resolves instances of AbstractJasperReportsView
by translating
the supplied view name into the URL of the report file.FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
DEFAULT_CACHE_LIMIT
logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
JasperReportsViewResolver() |
Modifier and Type | Method and Description |
---|---|
protected AbstractUrlBasedView |
buildView(String viewName)
Creates a new View instance of the specified view class and configures it.
|
protected Class<?> |
requiredViewClass()
Requires the view class to be a subclass of
AbstractJasperReportsView . |
void |
setExporterParameters(Map<String,Object> exporterParameters)
Set the
exporterParameters the view class should use. |
void |
setHeaders(Properties headers)
Set the
headers the view class should use. |
void |
setJdbcDataSource(DataSource jdbcDataSource)
Set the
DataSource the view class should use. |
void |
setReportDataKey(String reportDataKey)
Set the
reportDataKey the view class should use. |
void |
setSubReportDataKeys(String... subReportDataKeys)
Set the
subReportDataKeys the view class should use. |
void |
setSubReportUrls(Properties subReportUrls)
Set the
subReportUrls the view class should use. |
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
clearCache, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheLimit, setCacheUnresolved
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
protected Class<?> requiredViewClass()
AbstractJasperReportsView
.requiredViewClass
in class UrlBasedViewResolver
AbstractUrlBasedView
public void setReportDataKey(String reportDataKey)
reportDataKey
the view class should use.public void setSubReportUrls(Properties subReportUrls)
subReportUrls
the view class should use.public void setSubReportDataKeys(String... subReportDataKeys)
subReportDataKeys
the view class should use.public void setHeaders(Properties headers)
headers
the view class should use.public void setExporterParameters(Map<String,Object> exporterParameters)
exporterParameters
the view class should use.public void setJdbcDataSource(DataSource jdbcDataSource)
DataSource
the view class should use.protected AbstractUrlBasedView buildView(String viewName) throws Exception
UrlBasedViewResolver
Spring lifecycle methods as defined by the bean container do not have to
be called here; those will be applied by the loadView
method
after this method returns.
Subclasses will typically call super.buildView(viewName)
first, before setting further properties themselves. loadView
will then apply Spring lifecycle methods at the end of this process.
buildView
in class UrlBasedViewResolver
viewName
- the name of the view to buildException
- if the view couldn't be resolvedUrlBasedViewResolver.loadView(String, java.util.Locale)