KickJava   Java API By Example, From Geeks To Geeks.

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


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

15 public class WebCtorNut extends ConstructorNut {
16   private String JavaDoc servlet_context_property = WebUtils.DEFAULT_SERVLET_CONTEXT_PROPERTY;
17
18   public String JavaDoc getServlet_context_property() {
19     return servlet_context_property;
20   }
21
22   public void setServlet_context_property(String JavaDoc servlet_context_name) {
23     this.servlet_context_property = servlet_context_name;
24   }
25   protected Component informAwares(Component c) {
26     return WebUtils.setPossibleServletContext(super.informAwares(c), servlet_context_property, this);
27   }
28 }
29
Popular Tags