uk.co.lakesidetech.springxmldb.spring.web.controller
Class UrlFilenameXMLDBResourceController
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
uk.co.lakesidetech.springxmldb.spring.web.controller.AbstractXMLDBController
uk.co.lakesidetech.springxmldb.spring.web.controller.UrlFilenameXMLDBResourceController
- All Implemented Interfaces:
- org.springframework.context.ApplicationContextAware, org.springframework.web.servlet.mvc.Controller
- Direct Known Subclasses:
- AdvancedUrlFilenameXMLDBResourceController
- public class UrlFilenameXMLDBResourceController
- extends AbstractXMLDBController
The UrlFilenameXMLDBResourceController
retrieves a resource from the collection
using the filename of the request URL as the id. The controller retrieves the resource and if
it is a binary resource streams back the file. if it is an XML resource the xml document is added
to the model return as a Map with attribute results. The map contains the resource id as the key
and the XML document as the result.
- Author:
- Stuart Eccles
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_POST |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
Method Summary |
protected java.lang.String |
findFilenameFromPath(java.lang.String pathInfo)
finds the filename from the request path |
java.lang.String |
getFilenameSuffix()
|
org.springframework.web.servlet.ModelAndView |
handleRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
handle the request and return the resource as a binary stream or pass the xml document model
to the view to handle (either as XSLT, or straight XML or JSTL in a JSP page) |
void |
setFilenameSuffix(java.lang.String filenameSuffix)
|
Methods inherited from class uk.co.lakesidetech.springxmldb.spring.web.controller.AbstractXMLDBController |
formCollectionPathString, getCollection, getCollectionPrefix, getResultLimit, getView, getXmldbFacade, isAcceptCollectionFromRequest, replaceRequestParameterVariables, setAcceptCollectionFromRequest, setCollection, setCollectionPrefix, setResultLimit, setView, setXmldbFacade |
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController |
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession |
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, isContextRequired |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.web.servlet.mvc.Controller |
handleRequest |
UrlFilenameXMLDBResourceController
public UrlFilenameXMLDBResourceController()
setFilenameSuffix
public void setFilenameSuffix(java.lang.String filenameSuffix)
- Parameters:
filenameSuffix
- The filenameSuffix to set.
getFilenameSuffix
public java.lang.String getFilenameSuffix()
- Returns:
- Returns the filenameSuffix.
handleRequestInternal
public org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
- handle the request and return the resource as a binary stream or pass the xml document model
to the view to handle (either as XSLT, or straight XML or JSTL in a JSP page)
- Parameters:
request
- the HttpServletRequestresponse
- the HttpServletResponse
- Returns:
- The data model and view renderer
- Throws:
java.lang.Exception
- if anything goes wrong- See Also:
AbstractController.handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
findFilenameFromPath
protected java.lang.String findFilenameFromPath(java.lang.String pathInfo)
- finds the filename from the request path
- Parameters:
pathInfo
- the request path
- Returns:
- the filename