com.endeca.infront.web.spring
Class SpringUtility

java.lang.Object
  extended by com.endeca.infront.web.spring.SpringUtility
All Implemented Interfaces:
SessionIdProvider, ObjectLocator, ApplicationContextAware

public class SpringUtility
extends Object
implements ApplicationContextAware, SessionIdProvider, ObjectLocator

Utility for interacting with the Spring Framework.


Constructor Summary
SpringUtility()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringUtility

public SpringUtility()
Method Detail

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Implementation of the Spring ApplicationContextAware interface.

Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

getContextPath

public String getContextPath()
Retrieves the context path from the ServletContext via the Spring WebApplicationContext.

See Also:
ServletContext.getContextPath()

getRealPath

public String getRealPath()
Retrieves the real path from the ServletContext via the Spring WebApplicationContext.

See Also:
ServletContext.getRealPath(java.lang.String)

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Uses org.springframework.web to retrieve the current servlet request


getSessionId

public String getSessionId()
Uses org.springframework.web to retrieve the current servlet request's session id

Specified by:
getSessionId in interface SessionIdProvider
Returns:
the ID for the current user session

locate

public Object locate(String resource)
Retrieves a bean from the application context.

Specified by:
locate in interface ObjectLocator
Parameters:
resource - The id of the requested resource.
Returns:
The requested resource.


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.