KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > web > WebSpringBeanNut


1 package jfun.yan.web;
2
3 import jfun.yan.Component;
4 import jfun.yan.xml.nuts.spring.SpringBeanNut;
5 import jfun.yan.xml.nuts.spring.SpringService;
6 /**
7  * This class simply extends SpringBeanNut and set servlet context
8  * to components with the specified setter that accepts an ServletContext object.
9  * <p>
10  * The default setter name is "setServletContext".
11  * </p>
12  * <p>
13  * @author Ben Yu
14  * Jan 16, 2006 10:24:48 PM
15  */

16 public class WebSpringBeanNut extends SpringBeanNut {
17   private String JavaDoc servlet_context_property = WebUtils.DEFAULT_SERVLET_CONTEXT_PROPERTY;
18
19   public String JavaDoc getServlet_context_property() {
20     return servlet_context_property;
21   }
22
23   public WebSpringBeanNut(SpringService service) {
24     super(service);
25     
26   }
27
28   public void setServlet_context_property(String JavaDoc servlet_context_name) {
29     this.servlet_context_property = servlet_context_name;
30   }
31   protected Component informAwares(Component c) {
32     return WebUtils.setPossibleServletContext(super.informAwares(c), servlet_context_property, this);
33   }
34 }
35
Popular Tags