@Controller public class HomeController extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
RequestMapping
annotations in controller
components at method or type level are discovered.Constructor and Description |
---|
HomeController() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Create the meta data by querying the context for mappings.
|
String |
getResources(javax.servlet.http.HttpServletRequest request,
org.springframework.ui.ModelMap model)
Inspect the handler mapping at the level of HTTP
RequestMethod . |
Set<String> |
getUrlPatterns()
The set of unique URI patterns mapped, excluding implicit mappings.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setDefaultResources(Properties defaultResources)
Pre-configured mapping from url path to description for default (HTML)
resources.
|
void |
setJsonResources(Properties jsonResources)
Pre-configured mapping from url path to description for JSON resources.
|
void |
setServletPath(String servletPath)
The path that will be added to the model as an attribute ("servletPath")
before rendering.
|
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
ApplicationContextAware.setApplicationContext(ApplicationContext)
public void setServletPath(String servletPath)
servletPath
- the servlet path to setpublic void setDefaultResources(Properties defaultResources)
defaultResources
- the default resources to setpublic void setJsonResources(Properties jsonResources)
default resources
.jsonResources
- the json resources to setpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
InitializingBean.afterPropertiesSet()
@RequestMapping(value={"/","/home"}, method=GET) public String getResources(javax.servlet.http.HttpServletRequest request, org.springframework.ui.ModelMap model)
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).request
- the current servlet request (used to extract a page
attribute "sevletPath")model
- ModelMap
to be usedpublic Set<String> getUrlPatterns()
Copyright © 2015. All rights reserved.