Java Doc for SimpleTag.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 Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.jsp.tagext.SimpleTag

All known Subclasses:   javax.servlet.jsp.tagext.SimpleTagSupport,
SimpleTag
public interface SimpleTag extends JspTag(Code)
Interface for defining Simple Tag Handlers.

Simple Tag Handlers differ from Classic Tag Handlers in that instead of supporting doStartTag() and doEndTag(), the SimpleTag interface provides a simple doTag() method, which is called once and only once for any given tag invocation. All tag logic, iteration, body evaluations, etc. are to be performed in this single method. Thus, simple tag handlers have the equivalent power of BodyTag, but with a much simpler lifecycle and interface.

To support body content, the setJspBody() method is provided. The container invokes the setJspBody() method with a JspFragment object encapsulating the body of the tag. The tag handler implementation can call invoke() on that fragment to evaluate the body as many times as it needs.

A SimpleTag handler must have a public no-args constructor. Most SimpleTag handlers should extend SimpleTagSupport.

Lifecycle

The following is a non-normative, brief overview of the SimpleTag lifecycle. Refer to the JSP Specification for details.

  1. A new tag handler instance is created each time by the container by calling the provided zero-args constructor. Unlike classic tag handlers, simple tag handlers are never cached and reused by the JSP container.
  2. The setJspContext() and setParent() methods are called by the container. The setParent() method is only called if the element is nested within another tag invocation.
  3. The setters for each attribute defined for this tag are called by the container.
  4. If a body exists, the setJspBody() method is called by the container to set the body of this tag, as a JspFragment. If the action element is empty in the page, this method is not called at all.
  5. The doTag() method is called by the container. All tag logic, iteration, body evaluations, etc. occur in this method.
  6. The doTag() method returns and all variables are synchronized.

See Also:   SimpleTagSupport
since:
   2.0




Method Summary
public  voiddoTag()
     Called by the container to invoke this tag. The implementation of this method is provided by the tag library developer, and handles all tag processing, body iteration, etc.

The JSP container will resynchronize any AT_BEGIN and AT_END variables (defined by the associated tag file, TagExtraInfo, or TLD) after the invocation of doTag().
throws:
  javax.servlet.jsp.JspException - If an error occurred while processing this tag.
throws:
  javax.servlet.jsp.SkipPageException - If the page that(either directly or indirectly) invoked this tag is tocease evaluation.

public  JspTaggetParent()
     Returns the parent of this tag, for collaboration purposes.
public  voidsetJspBody(JspFragment jspBody)
     Provides the body of this tag as a JspFragment object, able to be invoked zero or more times by the tag handler.
public  voidsetJspContext(JspContext pc)
     Called by the container to provide this tag handler with the JspContext for this invocation.
public  voidsetParent(JspTag parent)
     Sets the parent of this tag, for collaboration purposes.



Method Detail
doTag
public void doTag() throws javax.servlet.jsp.JspException, java.io.IOException(Code)
Called by the container to invoke this tag. The implementation of this method is provided by the tag library developer, and handles all tag processing, body iteration, etc.

The JSP container will resynchronize any AT_BEGIN and AT_END variables (defined by the associated tag file, TagExtraInfo, or TLD) after the invocation of doTag().
throws:
  javax.servlet.jsp.JspException - If an error occurred while processing this tag.
throws:
  javax.servlet.jsp.SkipPageException - If the page that(either directly or indirectly) invoked this tag is tocease evaluation. A Simple Tag Handler generated from a tag file must throw this exception if an invoked Classic Tag Handler returned SKIP_PAGE or if an invoked SimpleTag Handler threw SkipPageException or if an invoked Jsp Fragmentthrew a SkipPageException.
throws:
  java.io.IOException - If there was an error writing to theoutput stream.




getParent
public JspTag getParent()(Code)
Returns the parent of this tag, for collaboration purposes. the parent of this tag



setJspBody
public void setJspBody(JspFragment jspBody)(Code)
Provides the body of this tag as a JspFragment object, able to be invoked zero or more times by the tag handler.

This method is invoked by the JSP page implementation object prior to doTag(). If the action element is empty in the page, this method is not called at all.
Parameters:
  jspBody - The fragment encapsulating the body of this tag.




setJspContext
public void setJspContext(JspContext pc)(Code)
Called by the container to provide this tag handler with the JspContext for this invocation. An implementation should save this value.
Parameters:
  pc - the page context for this invocation
See Also:   Tag.setPageContext



setParent
public void setParent(JspTag parent)(Code)
Sets the parent of this tag, for collaboration purposes.

The container invokes this method only if this tag invocation is nested within another tag invocation.
Parameters:
  parent - the tag that encloses this tag




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.