KickJava   Java API By Example, From Geeks To Geeks.

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


1 package jfun.yan.web;
2
3 import jfun.yan.Component;
4 import jfun.yan.xml.nuts.spring.SpringCtorNut;
5 import jfun.yan.xml.nuts.spring.SpringService;
6 /**
7  * This class simply extends SpringCtorNut 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 WebSpringCtorNut extends SpringCtorNut {
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 void setServlet_context_property(String JavaDoc servlet_context_name) {
24     this.servlet_context_property = servlet_context_name;
25   }
26   protected Component informAwares(Component c) {
27     return WebUtils.setPossibleServletContext(super.informAwares(c), servlet_context_property, this);
28   }
29
30   public WebSpringCtorNut(SpringService service) {
31     super(service);
32     
33   }
34 }
35
Popular Tags