public class SpringUtility extends Object implements ApplicationContextAware, SessionIdProvider, ObjectLocator
| Constructor and Description |
|---|
SpringUtility() |
| Modifier and Type | Method and Description |
|---|---|
String |
getContextPath()
Retrieves the context path from the
ServletContext
via the Spring WebApplicationContext. |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Uses org.springframework.web to retrieve the current
servlet request
|
String |
getRealPath()
Retrieves the real path from the
ServletContext
via the Spring WebApplicationContext. |
String |
getSessionId()
Uses org.springframework.web to retrieve the current
servlet request's session id
|
Object |
locate(String resource)
Retrieves a bean from the application context.
|
void |
setApplicationContext(ApplicationContext applicationContext)
Implementation of the Spring
ApplicationContextAware interface. |
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
ApplicationContextAware interface.setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic String getContextPath()
ServletContext
via the Spring WebApplicationContext.ServletContext.getContextPath()public String getRealPath()
ServletContext
via the Spring WebApplicationContext.ServletContext.getRealPath(java.lang.String)public javax.servlet.http.HttpServletRequest getHttpServletRequest()
public String getSessionId()
getSessionId in interface SessionIdProviderpublic Object locate(String resource)
locate in interface ObjectLocatorresource - The id of the requested resource.Copyright © 2013, Oracle and/or its affiliates. All rights reserved.