KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > event > StaticCodeIncludeLayoutEvent


1 package fr.improve.struts.taglib.layout.event;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4
5 import fr.improve.struts.taglib.layout.LayoutTag;
6 import fr.improve.struts.taglib.layout.util.ParentFinder;
7
8 /**
9  * Allow a tag to print static code to be included only once
10  * even if the current tag is nested in a hidden layer.
11  *
12  * @author JN Ribette
13  */

14 public class StaticCodeIncludeLayoutEvent extends AbstractLayoutEvent {
15     public StaticCodeIncludeLayoutEvent(LayoutTag in_tag, Object JavaDoc in_value) {
16         super(in_tag, in_value);
17     }
18
19     /**
20      * The tag calling this method should print the Object returned to its pageContext.
21      * @see fr.improve.struts.taglib.layout.event.AbstractLayoutEvent#send()
22      */

23     public Object JavaDoc send() throws JspException JavaDoc {
24         return sendToParent(source);
25     }
26     
27     public Object JavaDoc sendToParent(LayoutTag in_tag) throws JspException JavaDoc {
28         StaticCodeIncludeListener lc_listener = (StaticCodeIncludeListener) ParentFinder.findLayoutTag(in_tag, StaticCodeIncludeListener.class);
29         if (lc_listener!=null) {
30             return lc_listener.processStaticCodeIncludeEvent(this);
31         } else {
32             return value;
33         }
34     }
35
36 }
37
Popular Tags