KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > taglibs > LoadPagePath


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2005 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.taglibs;
14
15 import javax.servlet.jsp.JspException JavaDoc;
16 import javax.servlet.jsp.tagext.BodyTagSupport JavaDoc;
17
18
19 /**
20  * @author Marcel Salathe
21  * @version $Revision: 1111 $ ($Author: fgiust $)
22  */

23 public class LoadPagePath extends BodyTagSupport JavaDoc {
24
25     /**
26      * Stable serialVersionUID.
27      */

28     private static final long serialVersionUID = 222L;
29
30     /**
31      * @see javax.servlet.jsp.tagext.Tag#doEndTag()
32      */

33     public int doEndTag() throws JspException JavaDoc {
34         LoadPage parent = (LoadPage) findAncestorWithClass(this, LoadPage.class);
35         if (parent == null) {
36             throw new JspException JavaDoc("nesting error"); //$NON-NLS-1$
37
}
38         String JavaDoc path = getBodyContent().getString();
39         if (path != null) {
40             parent.setPath(path.trim());
41         }
42         return EVAL_PAGE;
43     }
44 }
45
Popular Tags