01: /*
02: * Created on 16 Oct 2006
03: */
04: package uk.org.ponder.rsf.servlet;
05:
06: import org.springframework.beans.BeansException;
07: import org.springframework.context.ApplicationContext;
08: import org.springframework.context.ApplicationContextAware;
09: import org.springframework.web.context.WebApplicationContext;
10:
11: import uk.org.ponder.rsf.viewstate.ContextURLProvider;
12: import uk.org.ponder.servletutil.ServletUtil;
13:
14: public class ServletContextCUP implements ContextURLProvider,
15: ApplicationContextAware {
16: String contextURL;
17:
18: public String getContextBaseURL() {
19: return contextURL;
20: }
21:
22: public void setApplicationContext(
23: ApplicationContext applicationContext)
24: throws BeansException {
25: WebApplicationContext wac = (WebApplicationContext) applicationContext;
26: contextURL = ServletUtil.computeContextName(wac
27: .getServletContext());
28: }
29:
30: }
|