JSP and JSTL Tutorials - Tutorial Addendum - JSP Tag Java Interface

lifestyleappsios windows appcolt educationappsios
 31 December 18:00   

    



    



    



    

javax.servlet.jsp.tagext.* Package

    



    

javax.servlet.jsp.tagext.* is a Java amalgamation authentic in J2EE

    

(I saw it in J2EE 1.3.1). This amalgamation contains:

    



        

  • Tag interface - The abject interface appropriate by a tag chic to collaborate

        

    with the JSP tag addendum facility.

        



  •     

  • IterationTag interface - Continued from Tag interface to abutment looping

        

    logic aural custom tags.

        



  •     

  • BodyTag interface - Continued from IterationTag interface to acquiesce

        

    custom tags to appraise their own body.

        



  •     

  • TagSupport class - Copy accomplishing of IterationTag interface .

        



  •     

  • BodyTagSupport class - Copy accomplishing of BodyTag interface .

        



  •     



    



    



    

BodyTag Interface

    



    

Since BodyTag interface requires added ability of JSP in adjustment to evaluate

    

the tag physique properly, we will altercate it later. For now, let s apply

    

on InterationTag interface only. Actuality is the account of methods appropriate by

    

InterationTag interface and their calling conditions:

    



        

  • setPageContext(PageContext pc) - A advice method, alleged afore calling doStartTag()

        

    to canyon the PageContext item to the tag object.

        



  •     

  • setParent(Tag t) - A advice method, alleged afore calling doStartTag()

        

    to canyon the ancestor tag item to the accepted tag object, in case the accepted tag

        

    is nested aural addition tag.

        



  •     

  • getParent() - A advice method, alleged by adolescent tag classes to admission

        

    grand ancestor tags.

        



  •     

  • doStartTag() - An interfacing point, alleged at the alpha of the action of the tag.

        



  •     

  • doAfterBody() - An interfacing point, alleged afterwards processing the body.

        



  •     

  • doEndTag() - An interfacing point, alleged if accessible to leave the action of the tag.

        



  •     

  • release() - An interfacing point, alleged afore catastrophe the action of the tag.

        



  •     



    



    

The accomplish acclimated by the JSP tag addendum ability to action a custom tag can be summarized

    

as follows:

    



        

  • Instanciating the tag object.

        



  •     

  • Calling setPageContext() and setParent() of the tag object.

        



  •     

  • Processing attributes of the tag. See my additional addendum on how aspect ethics are

        

    passed to the tag object.

        



  •     

  • Calling doStartTag() of the tag object, which may acknowledgment a banderole to appeal for skipping

        

    the physique to accomplish a codicillary physique logic.

        



  •     

  • Processing the physique of the tag.

        



  •     

  • Calling doAfterBody() of the tag object, which may acknowledgment a banderole to appeal for processing

        

    the physique afresh to accomplish a bend argumentation on the body.

        



  •     

  • Calling doEndTag() of the tag object.

        



  •     

  • Calling release() of the tag object.

        



  •     



    

(Continued on next part...)

    



    

 


Tags: point, class, process, custom, called, calling, processing, method, interface, notes, facility, tutorial, tutorials, object

 interface, object, calling, called, interfacing, dostarttag, point, process, processing, bodytag, class, iterationtag, custom, notes, method, logic, , tag object, point called, jsp tag, interfacing point, processing the, object calling, calling dostarttag, iterationtag interface, bodytag interface, method called, called before, interfacing point called, tag object calling, called before calling, tag object which, method called before, class dummy implementation, tutorials tutorial notes, tag java interface, tag extension facility, interface extended from, jstl tutorials tutorial,

Share JSP and JSTL Tutorials - Tutorial Addendum - JSP Tag Java Interface:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  jsp