Source Code Cross Referenced for BodyTagSupport.java in  » 6.0-JDK-Core » Servlet-API-by-tomcat » javax » servlet » jsp » tagext » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Servlet API by tomcat » javax.servlet.jsp.tagext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2004 The Apache Software Foundation
003         *
004         * Licensed under the Apache License, Version 2.0 (the "License");
005         * you may not use this file except in compliance with the License.
006         * You may obtain a copy of the License at
007         *
008         *     http://www.apache.org/licenses/LICENSE-2.0
009         *
010         * Unless required by applicable law or agreed to in writing, software
011         * distributed under the License is distributed on an "AS IS" BASIS,
012         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013         * See the License for the specific language governing permissions and
014         * limitations under the License.
015         */
016        package javax.servlet.jsp.tagext;
017
018        import javax.servlet.jsp.JspException;
019        import javax.servlet.jsp.JspWriter;
020
021        /**
022         * A base class for defining tag handlers implementing BodyTag.
023         *
024         * <p>
025         * The BodyTagSupport class implements the BodyTag interface and adds
026         * additional convenience methods including getter methods for the
027         * bodyContent property and methods to get at the previous out JspWriter.
028         *
029         * <p>
030         * Many tag handlers will extend BodyTagSupport and only redefine a
031         * few methods.
032         */
033
034        public class BodyTagSupport extends TagSupport implements  BodyTag {
035
036            /**
037             * Default constructor, all subclasses are required to only define
038             * a public constructor with the same signature, and to call the
039             * superclass constructor.
040             *
041             * This constructor is called by the code generated by the JSP
042             * translator.
043             */
044
045            public BodyTagSupport() {
046                super ();
047            }
048
049            /**
050             * Default processing of the start tag returning EVAL_BODY_BUFFERED.
051             *
052             * @return EVAL_BODY_BUFFERED
053             * @throws JspException if an error occurred while processing this tag
054             * @see BodyTag#doStartTag
055             */
056
057            public int doStartTag() throws JspException {
058                return EVAL_BODY_BUFFERED;
059            }
060
061            /**
062             * Default processing of the end tag returning EVAL_PAGE.
063             *
064             * @return EVAL_PAGE
065             * @throws JspException if an error occurred while processing this tag
066             * @see Tag#doEndTag
067             */
068
069            public int doEndTag() throws JspException {
070                return super .doEndTag();
071            }
072
073            // Actions related to body evaluation
074
075            /**
076             * Prepare for evaluation of the body: stash the bodyContent away.
077             *
078             * @param b the BodyContent
079             * @see #doAfterBody
080             * @see #doInitBody()
081             * @see BodyTag#setBodyContent
082             */
083
084            public void setBodyContent(BodyContent b) {
085                this .bodyContent = b;
086            }
087
088            /**
089             * Prepare for evaluation of the body just before the first body evaluation:
090             * no action.
091             *
092             * @throws JspException if an error occurred while processing this tag
093             * @see #setBodyContent
094             * @see #doAfterBody
095             * @see BodyTag#doInitBody
096             */
097
098            public void doInitBody() throws JspException {
099            }
100
101            /**
102             * After the body evaluation: do not reevaluate and continue with the page.
103             * By default nothing is done with the bodyContent data (if any).
104             *
105             * @return SKIP_BODY
106             * @throws JspException if an error occurred while processing this tag
107             * @see #doInitBody
108             * @see BodyTag#doAfterBody
109             */
110
111            public int doAfterBody() throws JspException {
112                return SKIP_BODY;
113            }
114
115            /**
116             * Release state.
117             *
118             * @see Tag#release
119             */
120
121            public void release() {
122                bodyContent = null;
123
124                super .release();
125            }
126
127            /**
128             * Get current bodyContent.
129             *
130             * @return the body content.
131             */
132
133            public BodyContent getBodyContent() {
134                return bodyContent;
135            }
136
137            /**
138             * Get surrounding out JspWriter.
139             *
140             * @return the enclosing JspWriter, from the bodyContent.
141             */
142
143            public JspWriter getPreviousOut() {
144                return bodyContent.getEnclosingWriter();
145            }
146
147            // protected fields
148
149            /**
150             * The current BodyContent for this BodyTag.
151             */
152            protected BodyContent bodyContent;
153        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.