KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > www > WebModuleInitTag


1 /*
2  * Copyright (c) 2006 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: WebModuleInitTag.java,v 1.4 2007/01/07 06:14:09 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21  
22 package org.opensubsystems.core.www;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25 import javax.servlet.jsp.JspException JavaDoc;
26
27 /**
28  * Custom tag to initialize the web module rendering. This needs to be the first
29  * tag of all web module tags and should be placed in the page before the html
30  * tag.
31  *
32  * @version $Id: WebModuleInitTag.java,v 1.4 2007/01/07 06:14:09 bastafidli Exp $
33  * @author Julian Legeny
34  * @code.reviewer Miro Halas
35  * @code.reviewed 1.1 2006/03/24 01:31:02 jlegeny
36  */

37 public class WebModuleInitTag extends PageElementCacheTag
38 {
39    // Attributes ///////////////////////////////////////////////////////////////
40

41    /**
42     * Generated serial version id for this class.
43     */

44    private static final long serialVersionUID = 5887888143382459204L;
45    
46    // Constructors /////////////////////////////////////////////////////////////
47

48    /**
49     * Constructor for custom tag.
50     */

51    public WebModuleInitTag()
52    {
53       super();
54    }
55    
56    // Business logic ///////////////////////////////////////////////////////////
57

58    /**
59     * {@inheritDoc}
60     */

61    public int doStartTag(
62    ) throws JspException JavaDoc
63    {
64       String JavaDoc contextpath;
65       StringBuffer JavaDoc sbBuffer = new StringBuffer JavaDoc();
66
67       contextpath = ((HttpServletRequest JavaDoc)pageContext.getRequest()).getContextPath();
68
69       /*
70       <link rel="StyleSheet" type="text/css" media="screen"
71             href="<%=contextpath%>/core/css/tabtoolbar.css" >
72       */

73       sbBuffer.append("<link HREF=\"");
74       sbBuffer.append(contextpath);
75       sbBuffer.append("/core/css/tabtoolbar.css\" rel=\"StyleSheet\"" +
76                       " type=\"text/css\" media=\"screen\">");
77       cache(PageElementCacheTag.CSS_ELEMENT, sbBuffer.toString());
78                
79       return (SKIP_BODY);
80    }
81
82    /**
83     * {@inheritDoc}
84     */

85    public int doEndTag(
86    ) throws JspException JavaDoc
87    {
88       return (EVAL_PAGE);
89    }
90 }
91
Popular Tags