org.springframework.batch.admin.web.util
Class HomeController

java.lang.Object
  extended by org.springframework.batch.admin.web.util.HomeController
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

@Controller
public class HomeController
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean

Component that discovers request mappings in its application context and reveals their meta data. Any RequestMapping annotations in controller components at method or type level are discovered.

Author:
Dave Syer

Constructor Summary
HomeController()
           
 
Method Summary
 void afterPropertiesSet()
          Create the meta data by querying the context for mappings.
 java.lang.String getResources(javax.servlet.http.HttpServletRequest request, org.springframework.ui.ModelMap model)
          Inspect the handler mapping at the level of HTTP RequestMethod.
 java.util.Set<java.lang.String> getUrlPatterns()
          The set of unique URI patterns mapped, excluding implicit mappings.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setDefaultResources(java.util.Properties defaultResources)
          Pre-configured mapping from url path to description for default (HTML) resources.
 void setJsonResources(java.util.Properties jsonResources)
          Pre-configured mapping from url path to description for JSON resources.
 void setServletPath(java.lang.String servletPath)
          The path that will be added to the model as an attribute ("servletPath") before rendering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeController

public HomeController()
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException
See Also:
ApplicationContextAware.setApplicationContext(ApplicationContext)

setServletPath

public void setServletPath(java.lang.String servletPath)
The path that will be added to the model as an attribute ("servletPath") before rendering. Defaults to the parent servlet path (as defined in the http servlet request).

Parameters:
servletPath - the servlet path to set

setDefaultResources

public void setDefaultResources(java.util.Properties defaultResources)
Pre-configured mapping from url path to description for default (HTML) resources.

Parameters:
defaultResources - the default resources to set

setJsonResources

public void setJsonResources(java.util.Properties jsonResources)
Pre-configured mapping from url path to description for JSON resources. If empty the description will be replaced with the one from the default resources.

Parameters:
jsonResources - the json resources to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Create the meta data by querying the context for mappings.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception
See Also:
InitializingBean.afterPropertiesSet()

getResources

@RequestMapping(value={"/","/home"},
                method=GET)
public java.lang.String getResources(javax.servlet.http.HttpServletRequest request,
                                                    org.springframework.ui.ModelMap model)
Inspect the handler mapping at the level of HTTP RequestMethod. Each URI pattern that is mapped can be mapped to multiple request methods. If the mapping is not explicit this method only returns GET (even though technically it would respond to POST as well).

Parameters:
request - the current servlet request (used to extract a page attribute "sevletPath")
Returns:
a map of URI pattern to request methods accepted

getUrlPatterns

public java.util.Set<java.lang.String> getUrlPatterns()
The set of unique URI patterns mapped, excluding implicit mappings. Implicit mappings include all the values here plus patterns created from them by appending "/" (if not already present) and ".*" (if no suffix is already provided).

Returns:
the set of unique URI patterns mapped


Copyright © 2011. All Rights Reserved.