HTMLEditorKit custom tags

Hi -
I am trying to add custom tags to HTMLEditorKit. Each tag an empty tag of the from <dataref id="_id"/>. I wish to replace all occurences of this tag with a value obtained from a hash table using "_Id".
I have subclassed HTMLEditorKit, getViewFactory, createDefaultDocument and registerTag. However, now I see an extra ">" and I have no clue as how to eliminate it. So if the value corresponding to "Id" is ABC, I see ABC>. This has been very frustrating.
Also, now other HTML elements are not rendered properly (if createDefaultDocument is overridden) the list elements are not rendered.
This has been very frustrating. Any suggestions would be very helpful. Thanks!

Hello,
HTMLEditorKit is mainly only about html 3.2 (with a few extensions here and there). So I don't think it understand auto-closing tags. Try <dataref id="_id"></dataref> instead.

Similar Messages

  • HTMLEditorKit, Custom Tags and CSS???

    I have an editor that will allow the user to insert merge fields. The document is in HTML and the editor supports basic document styling (bold, italics, etc).
    For the merge fields I would like to use either a custom tag or a generic tag like span. Unfortunately, HTMLEditorKit only supports HTML 3.2 (which does not contain the span tag). How can I create a custom tag called "merge"?
    Once I've created my custom tag, will the Cascading Style Sheet support in Java allow something like "merge {color: red}"?
    Any help of suggestions would be greatly appreciated!
    -- John

    Hi John,
    I'm trying to do the same thing (an editor for document containing merge fields...)
    For your first problem, I used the var tag which is not very used but exists in HTML 3.2 !
    And yes: HTMLDocument support CSS
    Since June, I think you've finded a solution
    If you success in creating a custom tag, please explain to me how do you make...
    my e-mail is [email protected]
    Thanks
    Luc

  • HTMLEditorKit: Inserting Custom Tags?

    How do you insert a custom tag into a HTML document? I've tried both:
    HTMLEditorKit.InsertHTMLTextAction( "merge", "<merge name=\"date\">DATE</merge>", HTML.Tag.BODY, new HTML.UnknownTag( "merge" ) )and
    kit.insertHTML( doc, offset, "<merge name=\"date\">DATE</merge>", 0, 0, new HTML.UnknownTag( "merge" ) );Both of these methods work fine for standard HTML tags.
    -- John

    I think you have to extend HTML.Tag, the following is quoted from the API documentation:
    Typesafe enumeration for an html tag. Although the set of html tags is a closed set, we have let the set open so that people can add their own tag types to their custom parser and still communicate to the reader.
    OTHER READERS PLEASE DON'T SHY GIVING A REPLY.
    (I have got no real experiences with the HTMLEditorKit.)

  • Adding custom tags and extend ParserDelegator and DTD support problem!!

    Hi all, I searched all forums and google for information about this problem but I did not find any clear solution or example.
    The probem stared when HTMLEditorKit's insertHTML method did not worked for custom tags.
    I extended javax.swing.text.html.parser.ParserDelegator class
    and override it's setDefaultDTD() method, which loads the default dtd (html32 definition). After the dtd field is created it I call this method:
              javax.swing.text.html.parser.Element element = _dtd.defineElement(
                  "template", javax.swing.text.html.parser.Element.SYSTEM, false, false,
                  null, null, null,
                  new AttributeList("value"));where _dtd is instance of DTD class in the same package, and "template" is the name of my custom tag.
    (if i define the element's type as CONTENT instead of SYSTEM the parser removes it)
    So after this,i see that my new tag is in DTD.elements vector and DTD.elementHash hastable, so its defined in DTD structures.
    The problem is that I have to redefine most element's ContentModel field "content" so that the parser will parse correctly the html source.
    Here is the tracing of DTD.elements vector default contents + template tag.Sorry for the long text but i just want to be clear
    Index i 0 element name #pcdata type 19 content null
    Index i 1 element name html type 18 content (head , body , plaintext?)
    Index i 2 element name meta type 17 content null
    Index i 3 element name base type 17 content null
    Index i 4 element name isindex type 17 content null
    Index i 5 element name head type 18 content (title? & isindex? & base? & nextid?)
    Index i 6 element name body type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 7 element name applet type 18 content ((p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)* | h1 | h2 | h3 | h4 | h5 | h6 | input | select | textarea | tr | td)*
    Index i 8 element name param type 17 content null
    Index i 9 element name p type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 10 element name title type 18 content (#pcdata*)*
    Index i 11 element name style type 18 content (#pcdata*)*
    Index i 12 element name link type 17 content null
    Index i 13 element name plaintext type 1 content null
    Index i 14 element name nextid type 17 content null
    Index i 15 element name script type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 16 element name h1 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 17 element name h2 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 18 element name h3 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 19 element name h4 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 20 element name h5 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 21 element name h6 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 22 element name ul type 18 content (p | br | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | ol | ul | li)*
    Index i 23 element name ol type 18 content (p | br | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | ol | ul | li)*
    Index i 24 element name dir type 18 content (ul | ol | dir | menu | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | li)*
    Index i 25 element name menu type 18 content (ul | ol | dir | menu | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | li)*
    Index i 26 element name pre type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 27 element name xmp type 1 content null
    Index i 28 element name listing type 1 content null
    Index i 29 element name dl type 18 content (p | dl | dt | dd)*
    Index i 30 element name div type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 31 element name center type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 32 element name blockquote type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 33 element name form type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 34 element name hr type 17 content null
    Index i 35 element name table type 18 content (tr | caption)*
    Index i 36 element name object type 18 content (param | (h1 | h2 | h3 | h4 | h5 | h6 | (p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)* | address)* | input | select | textarea)*
    Index i 37 element name tt type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 38 element name i type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 39 element name b type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 40 element name u type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 41 element name strike type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 42 element name s type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 43 element name big type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 44 element name small type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 45 element name sub type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 46 element name sup type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 47 element name em type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 48 element name strong type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 49 element name dfn type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 50 element name code type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 51 element name samp type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 52 element name kbd type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 53 element name var type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 54 element name cite type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 55 element name a type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | h1 | h2 | h3 | h4 | h5 | h6 | pre)*
    Index i 56 element name img type 17 content null
    Index i 57 element name font type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 58 element name basefont type 17 content null
    Index i 59 element name br type 17 content null
    Index i 60 element name map type 18 content (base | area)*
    Index i 61 element name nobr type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)+
    Index i 62 element name wbr type 17 content null
    Index i 63 element name blink type 19 content null
    Index i 64 element name input type 17 content null
    Index i 65 element name select type 18 content (option+)
    Index i 66 element name textarea type 18 content (#pcdata*)*
    Index i 67 element name address type 18 content ((#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea) | p)*
    Index i 68 element name frameset type 18 content (frameset | frame | noframes)*
    Index i 69 element name noframes type 1 content null
    Index i 70 element name nohotjava type 1 content null
    Index i 71 element name animate type 1 content null
    Index i 72 element name tr type 18 content (td | th | script | map)*
    Index i 73 element name td type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 74 element name area type 17 content null
    Index i 75 element name option type 18 content (#pcdata*)*
    Index i 76 element name dt type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 77 element name dd type 18 content (p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 78 element name li type 18 content ((p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)* | h1 | h2 | h3 | h4 | h5 | h6)*
    Index i 79 element name caption type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 80 element name frame type 17 content null
    Index i 81 element name th type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 82 element name template type 17 content null
    Can anyone plase give me advice how i can add my custom tag in this ContentModel structures for example as a content of "p" element
    I must do this for most structure elements.
    Or tell me any other way i can achieve the solution of my problem.
    A lot of topics here are still opened for solution for similar problems.
    and hope that there is any solution for my problem 'cause its urgent.
    Thanks in advance.
    Nenko Ivanov

    Hi all, I searched all forums and google for information about this problem but I did not find any clear solution or example.
    The probem stared when HTMLEditorKit's insertHTML method did not worked for custom tags.
    I extended javax.swing.text.html.parser.ParserDelegator class
    and override it's setDefaultDTD() method, which loads the default dtd (html32 definition). After the dtd field is created it I call this method:
              javax.swing.text.html.parser.Element element = _dtd.defineElement(
                  "template", javax.swing.text.html.parser.Element.SYSTEM, false, false,
                  null, null, null,
                  new AttributeList("value"));where _dtd is instance of DTD class in the same package, and "template" is the name of my custom tag.
    (if i define the element's type as CONTENT instead of SYSTEM the parser removes it)
    So after this,i see that my new tag is in DTD.elements vector and DTD.elementHash hastable, so its defined in DTD structures.
    The problem is that I have to redefine most element's ContentModel field "content" so that the parser will parse correctly the html source.
    Here is the tracing of DTD.elements vector default contents + template tag.Sorry for the long text but i just want to be clear
    Index i 0 element name #pcdata type 19 content null
    Index i 1 element name html type 18 content (head , body , plaintext?)
    Index i 2 element name meta type 17 content null
    Index i 3 element name base type 17 content null
    Index i 4 element name isindex type 17 content null
    Index i 5 element name head type 18 content (title? & isindex? & base? & nextid?)
    Index i 6 element name body type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 7 element name applet type 18 content ((p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)* | h1 | h2 | h3 | h4 | h5 | h6 | input | select | textarea | tr | td)*
    Index i 8 element name param type 17 content null
    Index i 9 element name p type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 10 element name title type 18 content (#pcdata*)*
    Index i 11 element name style type 18 content (#pcdata*)*
    Index i 12 element name link type 17 content null
    Index i 13 element name plaintext type 1 content null
    Index i 14 element name nextid type 17 content null
    Index i 15 element name script type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 16 element name h1 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 17 element name h2 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 18 element name h3 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 19 element name h4 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 20 element name h5 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 21 element name h6 type 18 content (img | br | hr | center | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 22 element name ul type 18 content (p | br | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | ol | ul | li)*
    Index i 23 element name ol type 18 content (p | br | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | ol | ul | li)*
    Index i 24 element name dir type 18 content (ul | ol | dir | menu | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | li)*
    Index i 25 element name menu type 18 content (ul | ol | dir | menu | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | li)*
    Index i 26 element name pre type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 27 element name xmp type 1 content null
    Index i 28 element name listing type 1 content null
    Index i 29 element name dl type 18 content (p | dl | dt | dd)*
    Index i 30 element name div type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 31 element name center type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 32 element name blockquote type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 33 element name form type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 34 element name hr type 17 content null
    Index i 35 element name table type 18 content (tr | caption)*
    Index i 36 element name object type 18 content (param | (h1 | h2 | h3 | h4 | h5 | h6 | (p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)* | address)* | input | select | textarea)*
    Index i 37 element name tt type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 38 element name i type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 39 element name b type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 40 element name u type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 41 element name strike type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 42 element name s type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 43 element name big type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 44 element name small type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 45 element name sub type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 46 element name sup type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 47 element name em type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 48 element name strong type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 49 element name dfn type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 50 element name code type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 51 element name samp type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 52 element name kbd type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 53 element name var type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 54 element name cite type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 55 element name a type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | h1 | h2 | h3 | h4 | h5 | h6 | pre)*
    Index i 56 element name img type 17 content null
    Index i 57 element name font type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | center | p | dl | ul | ol)*
    Index i 58 element name basefont type 17 content null
    Index i 59 element name br type 17 content null
    Index i 60 element name map type 18 content (base | area)*
    Index i 61 element name nobr type 18 content (#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)+
    Index i 62 element name wbr type 17 content null
    Index i 63 element name blink type 19 content null
    Index i 64 element name input type 17 content null
    Index i 65 element name select type 18 content (option+)
    Index i 66 element name textarea type 18 content (#pcdata*)*
    Index i 67 element name address type 18 content ((#pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea) | p)*
    Index i 68 element name frameset type 18 content (frameset | frame | noframes)*
    Index i 69 element name noframes type 1 content null
    Index i 70 element name nohotjava type 1 content null
    Index i 71 element name animate type 1 content null
    Index i 72 element name tr type 18 content (td | th | script | map)*
    Index i 73 element name td type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 74 element name area type 17 content null
    Index i 75 element name option type 18 content (#pcdata*)*
    Index i 76 element name dt type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 77 element name dd type 18 content (p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)*
    Index i 78 element name li type 18 content ((p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea)* | h1 | h2 | h3 | h4 | h5 | h6)*
    Index i 79 element name caption type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 80 element name frame type 17 content null
    Index i 81 element name th type 18 content (h1 | h2 | h3 | h4 | h5 | h6 | p | ul | ol | dir | menu | pre | xmp | listing | plaintext | dl | div | center | blockquote | form | isindex | hr | table | object | #pcdata* | tt | i | b | u | strike | s | big | small | sub | sup | em | strong | dfn | code | samp | kbd | var | cite | a | img | applet | object | font | basefont | br | script | map | nobr | wbr | blink | input | select | textarea | address | frameset | noframes | nohotjava | animate)*
    Index i 82 element name template type 17 content null
    Can anyone plase give me advice how i can add my custom tag in this ContentModel structures for example as a content of "p" element
    I must do this for most structure elements.
    Or tell me any other way i can achieve the solution of my problem.
    A lot of topics here are still opened for solution for similar problems.
    and hope that there is any solution for my problem 'cause its urgent.
    Thanks in advance.
    Nenko Ivanov

  • Why doesn't my custom tag work?

    First, my backend database is MS Access. Nothing I can do about that, unfortunately.
    I have defined three custom tags (no body, no attributes) to display report information from my project tracking/metrics Access database:
    <prefix:showProjectInfo />
    <prefix:showProjectTeam />
    <prefix:showProjectHistory />
    In my JSP, the first tag I use, <prefix:showProjectInfo />, works perfectly. However, <prefix:showProjectTeam /> gives no output.
    First, here is the tld file that defines the tags (report.tld):
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE taglib
            PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
            "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
        <tlib-version>1.0</tlib-version>
        <jsp-version>1.2</jsp-version>
        <short-name>report</short-name>
        <uri>/report</uri>   
        <!-- Forte4J_TLDX:  This comment contains code generation information. Do not delete.
        <tldx>
            <tagHandlerGenerationRoot>classes</tagHandlerGenerationRoot>
        </tldx>
        -->
        <!-- A validator verifies that the tags are used correctly at JSP
             translation time. Validator entries look like this:
          <validator>
              <validator-class>com.mycompany.TagLibValidator</validator-class>
              <init-param>
                 <param-name>parameter</param-name>
                 <param-value>value</param-value>
           </init-param>
          </validator>
       -->
       <!-- A tag library can register Servlet Context event listeners in
            case it needs to react to such events. Listener entries look
            like this:
         <listener>
             <listener-class>com.mycompany.TagLibListener</listener-class>
         </listener>
       -->
       <tag>
            <name>showProjectInfo</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectInfoTag</tag-class>
            <body-content>empty</body-content>
            <description>Shows the basic project information</description>       
       </tag>
       <tag>
            <name>showProjectTeam</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectTeamTag</tag-class>
            <body-content>empty</body-content>
       </tag>
       <tag>
            <name>showProjectHistory</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectHistoryTag</tag-class>
            <body-content>empty</body-content>
       </tag>
    </taglib>Next, here is the relevant section of web.xml that defines this taglib:
      <taglib>
            <taglib-uri>/WEB-INF/report.tld</taglib-uri>
            <taglib-location>/WEB-INF/report.tld</taglib-location>
      </taglib>Next, the code for showProjectTeamTag.java:
    * showProjectTeam.java
    * Created on March 9, 2005, 10:46 AM
    package mil.usaf.rad.metrics.report;
    import java.io.*;
    import java.sql.*;
    import java.lang.Integer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * @author  jason.ferguson
    public class showProjectTeamTag extends TagSupport
        public showProjectTeamTag()
            super();
        public int doAfterBody() throws JspException
            HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
            int pr_id = Integer.parseInt(req.getParameter("pr_id"));
            JspWriter out = pageContext.getOut();
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
               out.print("test");
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               conn = DriverManager.getConnection("jdbc:odbc:Metrics");
            catch (Exception e)
                throw new JspException(e.getMessage());
            String queryGetTeam = "SELECT Projects.pr_id, Accounts.name AS Name, Sum(Schedule.hours) AS SumOfhours FROM tblTAAccounts AS Accounts INNER JOIN ((tblTAScheduleEntries AS Schedule INNER JOIN tblProjectRelease AS ProjectRelease ON Schedule.projectID = ProjectRelease.tblFKTimeAccntProject) INNER JOIN tblPMProjects AS Projects ON ProjectRelease.Release_ID = Projects.pr_id) ON Accounts.accountID = Schedule.accountID WHERE Projects.pr_id=" + pr_id + " GROUP BY Projects.pr_id, Accounts.name, ProjectRelease.Release_number, Projects.Project_name";
            try
                out.print(queryGetTeam);
                stmt = conn.createStatement();
                rs = stmt.executeQuery(queryGetTeam);
                if (rs == null)
                    out.print("No Results!");
                out.print("<table>\n");
                out.print("<tr>\n");
                out.print("<th>Name</th>\n");
                out.print("<th>Total Hours</th>\n");
                out.print("</tr>\n");
                while(rs.next())
                    out.print("<tr>\n");
                    out.print("<td>" + rs.getString("Name") + "</td>\n");
                    out.print("<td>" + rs.getInt("SumOfhours") + "</td>\n");
                    out.print("</tr>\n");
                out.print("</table>\n");
                rs.close();
                stmt.close();
                conn.close();
            catch (Exception e)
                throw new JspException(e.getMessage());
            return SKIP_BODY;
    }Finally, projectdetail.jsp, where the tag is called:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.sql.*" %>
    <%@page import="java.lang.Integer" %>
    <%@taglib uri="/WEB-INF/report.tld" prefix="report" %>
    <html>
    <head><title>Project Detail</title></head>
    <body>
    <h1 align="center">Project Status</h1>
    <h3>Project Description</h3>
    <report:showProjectInfo />
    <h3>Team Members</h3>
    <report:showProjectTeam />
    </body>
    </html>The first tag, <report:showProjectInfo />, works fine. However, I get no output whatsoever when the system encounters <report:showProjectTeam />. I am a relative newbie at this, so any help is appreciated.
    Jason

    It doesnt seem to matter if the code is in doStartTag(), doEndTag(), orr any of the other functions.
    I also put, as the first item in the function:
    System.out.println("TEST");Nothing.
    Just as an aside, here is the code for the <prefix:showProjectInfo />. Maybe I made a mistake in it? I closed the resultset and connection...
    import java.io.*;
    import java.sql.*;
    import java.lang.Integer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * @author  jason.ferguson
    public class showProjectInfoTag extends BodyTagSupport
        public int doEndTag() throws JspException
            HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
            int pr_id = Integer.parseInt(req.getParameter("pr_id"));
            JspWriter out = pageContext.getOut();
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                conn = DriverManager.getConnection("jdbc:odbc:Metrics");
            catch (Exception e)
                throw new JspException(e.getMessage());
            String queryProjectInfo = "SELECT * FROM tblPMProjects WHERE pr_id=" + pr_id;
            try
                stmt = conn.createStatement();
                rs = stmt.executeQuery(queryProjectInfo);
                while (rs.next())
                    out.print("<table border=\"1\" style=\"border-collapse:collapse\">\n");
                    out.print("<tr>\n");
                    out.print("<td><b>Project Name:</b>" + rs.getString("Project_name") + "</td>\n");
                    out.print("<td align=\"right\"><b>RAD Number:</b>" + rs.getString("tblProjectNumber") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Project description: " + rs.getString("Project_description") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer: " + rs.getString("Customer_POC") + "</td>");
                    out.print("<tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer Unit: " + rs.getString("Customer_OFC") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer Phone: " + rs.getString("Customer_phone") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("</table>\n");
                    rs.close();
                    stmt.close();
                    conn.close();
            catch (Exception e)
                throw new JspException(e.getMessage());
            finally
                //conn.close();
            return SKIP_BODY;

  • Weblogic Commerce Server 3.5 runtime failure in custom tag

    An error occurred:
    javax.servlet.ServletException: runtime failure in custom tag 'process'
         at jsp_compiled._tools._property._propset_create._jspService(_propset_create.java:641)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:208)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:149)
         at com.beasys.commerce.foundation.flow.ServletDestinationHandler.handleDestination(ServletDestinationHandler.java:51)
         at com.beasys.commerce.foundation.flow.FlowManager.service(FlowManager.java:540)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:208)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1127)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1529)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    I just started getting this error after a year in production environment without any problems. Did you every find out what caused this or better yet how to prevent this?
              Dan.
              

  • Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

    Hi, can anyone advise as to whether my tag library code (based
    on Apache Jakarta Project) will actually achieve connection
    pooling functionality across my entire JSP based application? I
    am slightly concerned that my OracleConnectionCacheImpl object
    may exist multiple times, hence rendering my conection pooling
    attempt useless.
    package com.solved.tag.dbtags.connection;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    import javax.servlet.jsp.JspTagException;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.jdbc.pool.OracleConnectionCacheImpl;
    * <p>JSP tag connection, used to get a
    * java.sql.Connection object.</p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>connection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
    agclass>
    * &lt;bodycontent>JSP&lt;/bodycontent>
    &lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
    eiclass>
    * &lt;info>Opens a connection based on a jndiName.&lt;/info>
    * &lt;attribute>
    * &lt;name>id&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    public class ConnectionTag extends TagSupport {
    static private OracleConnectionCacheImpl cache = null;
    public int doStartTag() throws JspTagException {
    try {
    Connection conn = null;
    if (cache == null) {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup
    ("jdbc/pool/OracleCache");
    cache = (OracleConnectionCacheImpl)ds;
    catch (NamingException ne) {
    throw new JspTagException(ne.toString());
    conn = cache.getConnection();
    pageContext.setAttribute(getId(),conn);
    catch (SQLException e) {
    throw new JspTagException(e.toString());
    return EVAL_BODY_INCLUDE;
    package com.solved.tag.dbtags.connection;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    * <p>JSP tag closeconnection, used to close the
    * specified java.sql.Connection.<p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>closeConnection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
    lt;/tagclass>
    * &lt;bodycontent>empty&lt;/bodycontent>
    * &lt;info>Close the specified connection. The "conn"
    attribute is the name of a
    * connection object in the page context.&lt;/info>
    * &lt;attribute>
    * &lt;name>conn&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    * @see ConnectionTag
    public class CloseConnectionTag extends TagSupport {
    private String _connId = null;
    * The "conn" attribute is the name of a
    * page context object containing a
    * java.sql.Connection.
    * @param connectionId
    * attribute name of the java.sql.Connection to
    close.
    * @see ConnectionTag
    public void setConn(String connectionId) {
    _connId = connectionId;
    public int doStartTag() {
    try {
    Connection conn = (Connection)pageContext.getAttribute
    (_connId);
    conn.close();
    } catch (SQLException e) {
    // failing to close a connection is not fatal
    e.printStackTrace();
    return EVAL_BODY_INCLUDE;
    public void release() {
    _connId = null;
    package com.solved.tag.dbtags.connection;
    import javax.servlet.jsp.tagext.TagData;
    import javax.servlet.jsp.tagext.TagExtraInfo;
    import javax.servlet.jsp.tagext.VariableInfo;
    * TagExtraInfo for the connection tag. This
    * TagExtraInfo specifies that the ConnectionTag
    * assigns a java.sql.Connection object to the
    * "id" attribute at the end tag.
    * @author Matt Shannon
    * @see ConnectionTag
    public class ConnectionTEI extends TagExtraInfo {
    public final VariableInfo[] getVariableInfo(TagData data)
    return new VariableInfo[]
    new VariableInfo(
    data.getAttributeString("id"),
    "java.sql.Connection",
    true,
    VariableInfo.AT_END
    data-sources.xml:
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-
    sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    name="jdbc/pool/OracleCache"
    location="jdbc/pool/OracleCache"
    url="jdbc:oracle:thin:@oracle1:1521:pdev"
    >
    <property name="maxLimit" value="15" />
    <property name="cacheScheme" value="2" />
    <property name="user" value="console" />
    <property name="password" value="console" />
    <description>
    This DataSource is using an Oracle-native DataSource Class so as
    to allow Oracle Specific extensions.
    A getConnection() call on this DataSource will return
    oracle.jdbc.driver.OracleConnection.
    The connection returned is a logical connection.
    The caching scheme in place is Fixed Wait. Refer below to
    possible values.
    Dynamic 1
    Fixed Wait 2
    Fixed Return Null 3
    </description>
    </data-source>
    </data-sources>
    many thanks,
    Matt.

    Hi. Show me your pool definition.
    Joe
    Ramamurthy wrote:
    I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
    I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
    When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
    "javax.servlet.jsp.JspException: Failed to write body content
    at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
    After this message, whenever I try to access the same jsp page I am getting the message
    "javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
    river
    at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
    Can you please help me the reason why this problem is happening and how to fix this ?
    This problem doexn't happen consistently. This occurs once in a while.
    I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
    Thanks for your help !!!
    Ram

  • Is possible to write a custom tag inside another custom tag ??

    Hi
    I�m trying to reduce the time needed to code mi app presentation layer, it uses some custom tags with certain configuration, i would like to know if its possible to do something like this inside my custom tag doAfterBody().
    public int doAfterBody() throws JspException {
              JspWriter writer=bodyContent.getEnclosingWriter();
              try {
                   writer.print("<customTag:myAnotherTag someEspecificConfigurationParams="someEspecificValues"/>");
              } catch (IOException e) {
                   pageContext.getServletContext().log("Error: "+e.getMessage());
              }return SKIP_BODY;
         }The goal is to simplify the jsp code because the configuration params for the custom tags (css styles and similar) are allways the same.
    That don�t work, it simply prints <customTag:myAnotherTag/> in screen but the tag is not evaluated, i�ve tried too something like
    public int doAfterBody() throws JspException {
              if (repeat) {
                   JspWriter writer = bodyContent.getEnclosingWriter();
                   try {
                        writer.print("<customTag:myAnotherTag/>");
                   } catch (IOException e) {
                        pageContext.getServletContext().log("Error: " + e.getMessage());
                   repeat = false;
                   return EVAL_BODY_AGAIN;
              return SKIP_BODY;
         }And it doesn�t worked worked. Maybe using the taghandler classes and calls to the doAfterBody could make it work, but when you need to nest tags it could be a little hell of coupling calls, so before doing it i would like to know if what i want is possible. After reading some books i tought it could work because the stack of out objects, but i can�t make it work.
    Another idea is to inherit from tagHandler and override some properties in the tags, but i don�t like the idea to much.
    So, can anyone help me??
    Thanks.

    You cannot do that and I have listed out the reason and a possible solution in this post http://forum.java.sun.com/thread.jspa?threadID=697243 from yesterday.
    cheers,
    ram.

  • How to prepare Custom tag with scope as  session  like Struts tag

    Hi
    All Struts tags having the feature of Automatic Scoping.
    Automatic Scoping: Struts tags check all contexts (namely page, request, session, application) and use the first instance found. Developers do not have to explicitly "retrieve" objects from a particular scope. They may, however, specify a context.
    same as like struts tag I want to preapre 'select custom tag'.which will retrieve its previous selected value automatically and display.And one important thing is I dont want to set the selected value of custom tag in session expicitly.I mean the custom tag it self should take care to set the session vale and retrieve the sesion value and display like Struts tag . For struts select tag we wont set any selected value in session though it will retrieve the previous value and display when scope of form = session
    regards
    jagan

    Hi
    All Struts tags having the feature of Automatic Scoping.
    Automatic Scoping: Struts tags check all contexts (namely page, request, session, application) and use the first instance found. Developers do not have to explicitly "retrieve" objects from a particular scope. They may, however, specify a context.
    same as like struts tag I want to preapre 'select custom tag'.which will retrieve its previous selected value automatically and display.And one important thing is I dont want to set the selected value of custom tag in session expicitly.I mean the custom tag it self should take care to set the session vale and retrieve the sesion value and display like Struts tag . For struts select tag we wont set any selected value in session though it will retrieve the previous value and display when scope of form = session
    regards
    jagan

  • Make new custom tag in A2

    Good evening,
    I'm trying to add a custom tag to an image in Aperture 2.0. I've looked all over the internet and find no examples what so ever of AS and Aperture 2.0.
    I have a few guesses that produce one of two different errors - but no idea how to actually make this work. Any ideas ?
    tell application "Aperture"
    copy selection to theSel
    repeat with curImg in theSel
    class of curImg
    --image version
    -- make new custom tag at curImg with properties {name:"NewTag", value:"New Tag's Value"}
    -- set aNewTag to make new custom tag with properties {name:"NewTag", value:"New Tag's Value"}
    -- Aperture got an error: Can’t make or move that element into that container.
    -- make new custom tag at end of curImg with properties {name:"NewTag", value:"New Tag's Value"}
    -- make new custom tag at end of (curImg) with properties {name:"NewTag", value:"New Tag's Value"}
    -- make new custom tag at end of custom tags of curImg with properties {name:"NewTag", value:"New Tag's Value"}
    -- make new custom tag at end of curImg's custom tags with properties {name:"NewTag", value:"New Tag's Value"}
    --Aperture got an error: Can’t make application "Aperture" into type specifier.
    end repeat
    end tell

    If I recall, it was done because how tags were to be handled in 1.2 was very different from 1.1 and it was felt that developers shouldn't rely on implementation specific classes (unless they were SPI) for several other reasons (application portability being the big one here).
    If it's felt that this was the wrong decision, please feel free to log an issue [1] against the RI (to date, no one has).
    As to the 'borked' dependency URLs, please log an issue [1] if you find these. We have nightly builds going that work from a clean workspace and checking today's result, it seems ok.
    [1] https://javaserverfaces.dev.java.net/issues

  • Passing Javascript Enabled or Disabled value in a custom tag

    Hi,
    In my JSP I am using a custom tag.
    This custom tag is having one attribute called status(whose value will be jsenabled means true or jsdisabled means false) depending on the browser's javascript enabled or disabled
    How can i find the value of javascript enabled or javascript disabled and set the value of the attribute status in my jsp.
    This is the custom tag
    <t:tab summary="tabs" url="/services/eservicepac/registrationprocess/process.wss" tabNames='<%=tabList%>' currentTab="<%=currentTab%>" zone="WWW_ZONE" fetchText="false" status=" "
    </t:tab>
    The value of this attribute status=" " should be the value of jsenabled or disabled.
    Since the user can visit any page at any time, the jsenabled value is not maintained in session or request, so i can't take from session or request also.
    As this is urgent,
    --I am expecting the reply                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Merlin,
    In addition to what was written above, you must make sure that you tell your web application to run as a JSP 2.0 web application.
    You do this by defining your web.xml a little differently. Like this at the top:
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd">
    That should be what you need to get it working correctly.
    Damian Sutton

  • How to create a custom tag for a custom converter

    In Jdeveloper 11g, I have a project where I have created a custom converter class that impements the javax.faces.convert.Converter class. I have registered the converter with an id in the faces-config.xml file of the project, and the converter works fine by using the <f:converter type="myconverter"> tag. However, the custom converter has a field which I would like to set from the tag itself. Hence, I would like to add an attribute to <f:converter> tag if possible or create a custom tag that has the attribute.
    I have done some reserach and I found that a custom tag can be implemented: I need to create a class which extends from the ConverterTag class or javax.faces.webapp.ConverterElTag class, which I did, but I also need to create ".tld" (tag library) file which defines the tag itself.
    The part about creating the ".tld" file and registring the new tag is what I'm not sure how to do.
    Does someone know how to do this?
    thank you

    Hi frank,
    that's a good document, and it explains how to make a custom converter. I already created the custom converter, it converts a number to any currency pattern. I know java already has a currency converter, but it doesn't support Rupee currency format, and I need that format.
    My converter works, but I would like to pass the pattern of the format through an attribute in a tag. Since f:converter doesn't seem to support that, I created a custom tag which uses my converter, and it enables me to pass a pattern to the converter.
    All of that works, but I need to be able to pass the pattern as an EL expression, and it's not evaluating the expression before passing it to the converter. It just passes the whole expression as a string. I'm thinking It may be something I'm doing wrong.
    this is the tag library definition file:
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.2</tlib-version>
    <jsp-version>2.1</jsp-version>
    <short-name>custom</short-name>
    <uri>custom-currency-converter</uri>
    <description>
    custom currency custom tag library
    </description>
    <tag>
    <name>CurrencyConverter</name>
    <tag-class>
    converter.Tag.CurrencyConverterTag
    </tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <name>pattern</name>
    <type>java.util.String</type>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    Edited by: Abraham Ciokler on Feb 4, 2011 11:20 AM

  • How To create a custom tag in jsf

    I'm trying to create a custom tag in jsf.what should be the approach to create it.it would be better if somebody will explain me from the skretch.

    There's a decent tutorial here, Priyo:
    http://www.exadel.com/tutorial/jsf/HowToWriteYourOwnJSFComponents.pdf
    Hope it helps,
    Illu

  • Simple question about custom tags really easy!!

    I am trying to make my own custom tags, so far i have created simple one that have i use for heading or to set the page layout for a jsp page, My question is I want to make a custom tag with a body , with a start and end tag can anybody give a simple example of a custom tag which has a body.
    I do not mean write me a tag i mean what could a tag with a body be used for? Can you give me some example of what a tag of this kind could do?

    Thanks having read that and some other pages i have another question:
    would it be possible to put the following code into a custom tag so that i can pass in a list and have it output it to a table?
    <TABLE >
    <% 
    out.println("<TABLE >\n" +
                    "<TR BGCOLOR=\"#FFDDAA\">\n" +
                    "  <TH>ID Number\n" +
                    "  <TH>Artist\n"
    Iterator it = pricePassed.getpricePassed().iterator();
    while( it.hasNext() ){
       MySite.VideoBean vids = (MySite.VideoBean) it.next();
       out.println( "<TR>\n" +
                   "<TD><Center><B>" + vids.getRecId() + "</TD>" +
                    "<TD><Center><B>" + vids.getArtist() + "</TD>"
    </TD></TR>\n" );
    %></TABLE>At the moment i use the above in a jsp to put data into a table, would it be a massive task to undertake to put into a custom tag?

  • Question about custom tags

    Hi All,
    Please tell me what is differnce between javabean and custom tags.
    thank you.

    Javabean is a data object (or a data holder) whose properties can be accessed using getters, setters - ex getName() and setName()
    JSP custom tags are merely Java classes that implement special interfaces (Tag interface). Once they are developed and deployed, their actions can be called from your HTML using XML syntax. Refer the article http://java.sun.com/developer/technicalArticles/xml/WebAppDev3/
    Cheers,
    Janesh

Maybe you are looking for

  • SharePoint Item level permission is not been carrying to Folder and Library permission SharePoint 2013

    Good Day I have a document library with multiple folders containing documents. Security "Group A" views all content. Security "Group B" gets granted permission from the users in Group A by running a workflow. Problem: When users in "group A" runs the

  • Sports highlight

    i want to make a football highlight video/movie for my son. Is it a way I can point him out from the rest of the football player by either placing an arrow over him or by making him glow in a still frame. Can anybody in the MAC world help me with thi

  • IPhone 5 power button randomly presses itself

    The past few days, my iPhone 5 has randomly pressed the power button and my screen will lock or go to a black screen that says "slide to power off". It does this over and over. I made a copy of the phone right after it started happening and then rest

  • Album import question

    For some unknown reason my Itunes account is taking some albums that I import and creating separate albums for each song. Is this because I have numerous albums that I import with different artists on it? Could this be the reason that It's separating

  • Show ip mfib all

    IP Multicast Forwarding Information Base Entry Flags: C - Directly Connected, S - Signal, IC - Internal Copy X - Inactive, D - Dormant, * - MFIB special entry Interface Flags: A - Accept, F - Forward, S - Signal IC - Internal Copy, NP - Not Platform