Custom Tag and CFC : Nate Weiss

Hi,
being a beginner I'm trying with some marginal degree of
success to understand CFC's and Custome Tags.
In the CFMX7 W.A.C.K. There is an example shopping cart. This
start off as a basic affair then expands into more object based
principles using a custom tag add products to the cart
(ShoppingCart.cfc) and later on the same page uses a custome Tag to
display the cart items, calling it once for each item to display.
I am using the MVC structure under Fusebox 4, so this method
of using the same template, (reloading etc) is alien to me as with
MVC you usually have the data type intructions in different files
(anyway, I digress)
Now that I have the thing adding products and generally
working with my "shop", I thought about having a "special offer"
facility. With these "Hot Deals" being stored in another database
table, with their productID and new price.
However, obviously the shopping cart needs to be made aware
of this. With I would have thought an extra variable in the array
telling the custom tag to retrieve the special price and the
product information using a diufferent inner join query to normal.
I have attemtped this by adding an additional URL parameter
thus /..../HSOP/Y ("Has Special Offer Price" being set to "Y")
When this reloads the page the CFC invoke is set thus
<CFIF IsDefined("URL.HSOP") AND #URL.HSOP# EQ "Y">
<CFINVOKE
COMPONENT="#SESSION.MyShoppingCart#"
METHOD="Add"
MERCHID="#URL.AddMerchID#"
SOPH="Y">
<cfelse>
This successfully passes
Add(SOPH = Y, MERCHID = xxxx)
to the CFC. However I get this error......,
..................Element SOPH is undefined in ARGUMENTS.
the CFC simpley isnt adding the new variable to the array...
I think... it wont do a CFDump so there is no way of telling
<CFFUNCTION
NAME="Add"
HINT="Adds an item to the shopping cart">
<!--- Three Arguments: MerchID, Quantity and SOPH (flag
to state if there is a special price) --->
<CFARGUMENT NAME="MerchID" TYPE="numeric"
REQUIRED="Yes">
<CFARGUMENT NAME="Quantity" TYPE="numeric" REQUIRED="No"
DEFAULT="1">
<CFARGUMENT NAME="SOPH" type="string">
<!--- Get structure that represents this item in cart,
--->
<!--- then set its quantity to the specified quantity
--->
<CFSET CartItem = GetCartItem(MerchID)>
<CFSET CartItem.Quantity = CartItem.Quantity +
Arguments.Quantity>
<CFSET CartItem.SOPH = Arguments.SOPH>
</CFFUNCTION>
I cant see why this wouldn't create the variable
"CartItem.SOPH" and set it to "Y" as passed to it.
I notice the CFC performs an iteration of sorts to put the
cart items into an array. But I'm afraid I cant fathom what this
problem might be.
Any ideas. I have attached the whole CFC code (post editing
by me)
MAny thanks and Happy new Year

Hi,
As for me, I am testing the related pdf-417 barcode scanner these days. Do you have any ideas about it? Or any good suggestion? I am totally a green hand on barcode field. Any suggestion will be appreciated. Thanks in advance.
Best regards,
Arron

Similar Messages

  • Custom Tag and Attribute Not Found

    Hi,
    I've been getting an error with the following code in a JSP called cardDeclined.jsp...
    <gwps:log level="ERROR" message="<%= request.getAttribute("errorMessage") %>" />gwps:log is a custom tag and errorMessage is a request attribute set in a servlet that includes my JSP. When I execute the program, I get a message from the servlet container (Tomcat 3.2.3) stating that "attribute 'errorMessage' has no value".
    I wrote some test code that dumps out "errorMessage"; that seemed to work. The JSP request object has a value for "errorMessage." So, I now use the following workaround...
    <% String message = (String)request.getAttribute("errorMessage"); %>
    <gwps:log level="ERROR" message="<%= message %>" />I'm looking for a reference describing how request and session variables can be passed to the custom tag
    Thanks,
    CW

    I think you might be having a problem with the quotes. Try this instead:
    <gwps:log level="ERROR" message='<%= request.getAttribute("errorMessage") %>' />
    Notice the single quotes around the scriptlet.

  • Difference b/w a custom tag and cfinclude

    Hi,
    can anyone pls describe the difference between a cold fusion
    custom tag and cfinclude. Or how they are processed in the server?
    While we use the custom tag it nearly functions same as
    cfinclude....i can't think of any ...

    ajithmanmu wrote:
    > Hi,
    > can anyone pls describe the difference between a cold
    fusion custom tag and
    > cfinclude. Or how they are processed in the server?
    While we use the custom tag
    > it nearly functions same as cfinclude....i can't think
    of any ...
    >
    <cfinclude...> does just that. It logically includes
    the code in the
    current template to be parsed at that point and time. With
    <cfinclude...> the code exists in the same scope is the
    entire template
    sharing all variables.
    A custom tag is a separate template with it's own local
    variables as
    well as start and end states that can be used to create much
    more
    sophisticated interactions. One thing that a custom tag can
    do that an
    include can not do is reiteration, where a tag can
    dynamically call itself.

  • 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

  • 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

  • JSP Custom Tag and Expressions for parameters

    This should be an easy question. I am trying to use an expression for a
              parameter to a jsp or custom jsp tag. When I hard code a value for the
              parameter, the tag works fine but when I use the expression, the expression
              gets evaluated but the tag itself does not resulting in the tag being shown
              in my output.
              For example:
              <jsp:forward page="www.slashdot.org"/> works
              <jsp:forward page="<%=request.getParameter("DESTINATION")%>"/>
              places the following into my html output
              <jsp:forward page="www.slashdot.org"/>
              Can someone please tell me what I am doing wrong or at least offer some
              debugging hints?
              Thanks in advance!
              Jacob Meushaw
              

    I have experienced almost this exact same problem, but with a custom
              tag. And I did make sure that my attribute specified
              <rtexprvalue>true</rtexprvalue>. Here is the weird part.
              If I do the following JSP code everything works fine:
              <% String foo = request.getParameter("bar"); %>
              <mytag:custom param="<%= foo %>"/>
              But if I do this:
              <mytag:custom param="<%= request.getParameter("bar") %>"/>
              I get the following in my html output:
              <mytag:custom param="whatever bar is set to in the request"/>
              It appears that the JSP container only does a one pass evaluation.
              Is this the spec of is this a bug?
              Jacob Meushaw wrote:
              >
              > This should be an easy question. I am trying to use an expression for a
              > parameter to a jsp or custom jsp tag. When I hard code a value for the
              > parameter, the tag works fine but when I use the expression, the expression
              > gets evaluated but the tag itself does not resulting in the tag being shown
              > in my output.
              >
              > For example:
              >
              > <jsp:forward page="www.slashdot.org"/> works
              >
              > <jsp:forward page="<%=request.getParameter("DESTINATION")%>"/>
              > places the following into my html output
              > <jsp:forward page="www.slashdot.org"/>
              >
              > Can someone please tell me what I am doing wrong or at least offer some
              > debugging hints?
              >
              > Thanks in advance!
              >
              > --
              > Jacob Meushaw
              Jeff Smith
              [email protected]
              BEA Systems, Inc.
              720-565-6613
              

  • Between custom tag and scriptlets

    Hi,
    Is it possible to choose between executing a custom tag or a scriptlet based on a jsp variable? I mean to do something like--
    <%
    if(condition is true)
    custom tag execution
    else
    some normal jsp code
    continue after if
    %>

    You could do something like this...
    In your tag class code, based on a condition, you could execute some code in your tag class (and do not include the tag body upon returning). If the condition is not met, then you could simply return from the tag, and execute the body of the tag (which would be the JSP code).

  • Custom tag and JSP = getOutputStream error

    Hi guys. I have a custom authorization tag as follows:
    package tags;
    import stuff;
    public class AuthenticatedTag extends TagSupport {
         public int doStartTag() throws JspException {
              try {
                   pageContext.forward("login.htm");
              } catch (Exception e) {
                   e.printStackTrace();
              return EVAL_PAGE;
         public int doEndTag() throws JspException {
              return EVAL_PAGE;
    }and a jsp page using this tag:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" errorPage="error.jsp" %>
    <%@ taglib uri="/WEB-INF/tags.tld" prefix="tags" %>
    <tags:myauth />
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>stuff
    </body>
    </html>When I point my browser to this jsp I get:
    org.apache.jasper.JasperException: getOutputStream() has already been called for this response
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:383)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Any ideas of what could be wrong? thx

    If you forward to the login.htm page, you should stop the rest of the current page evaluating. Just because you forwarded it, doesn't stop the flow of control in this page. It is trying to evaluate both the current page and the one that you forwarded to. You can only send one response
    Returning SKIP_PAGE from the doEndTag function should do the trick.
    I'm not sure that returning EVAL_PAGE or SKIP_PAGE from the doStartTag is legal. It should return SKIP_BODY or one of the EVAL_BODY options.
    In fact I think the whole thing should probably be done in the doEndTag for that reason.
    package tags;
    import stuff;
    public class AuthenticatedTag extends TagSupport {
         public int doEndTag() throws JspException {
              try {
                   pageContext.forward("login.htm");
                            return SKIP_PAGE
              } catch (Exception e) {
                   e.printStackTrace();
              return EVAL_PAGE;
    }I presume you will be putting in some sort of check to see if you should forward to login.html instead of evaluating the current page?
    Just as an alternative suggestion, a better way IMO is to implement this sort of logic as a filter, rather than putting a tag on a JSP page.
    Cheers,
    evnafets

  • Question: TLD and custom Tag Usage.

    Hi, I am new to the custom tags and I am confused with one of the examples.
              The TLD has
              <tag>
              <name>item</name>
              <tagclass>com.taglib.wdjsp.mut.OutlineItemTag</tagclass>
              <bodycontent>JSP</bodycontent>
              <info>
              Delineates an item, possibly including subitems,
              within a nested outline.
              </info>
              <attribute>
              <name>text</name>
              <required>true</required>
              <rtexprvalue>true</rtexprvalue>
              </attribute>
              </tag>
              This TLD specifies that the tag has body content that is JSP and not empty.
              The author uses the tag in the JSP page in the following way..
              <mut:item text="What is JSP"/>
              <mut:item text="Evolution of dynamic content technologies">
              <mut:item text="Common Gateway Interface"/>
              </mut:item>
              I wonder why the usage "<mut:item text="What is JSP"/>" - where the
              bodycontent is empty - does not violate the TLD.
              Is the bodycontent optional even if it is specified in TLD. What if it is
              tagdependent?
              thanks - Sri
              

    then in your code
    public void setEnabled(String enabled) {
    this.enabled = true;
    in your endtag reset the boolean to false;
    IMO, a cleaner approach would be
    private boolean enabled = false;
    public void setEnabled(boolean enabled) {
         this.enabled = enabled;
    }The advanatge is that
    <foo other_attributes enabled= "false"/> and
    <foo other_attributes/> will both evaluate to false;
    <foo other_attributes enabled= "true"/> will evaluate to true
    <foo other_attributes enabled= "will_this_work"/> will give an exception
    as the container cannot resolve it to a boolean value so that users will
    be forced to use true or false (or skip the attribute) which is how it
    should be.
    Also note the container cannot convert runtime expressions to boolean
    values. So if there's a String variable,say prompt in scope that has the
    value true, then<%
    String prompt = "true";
    pageContext.setAttribute("prompt", prompt);
    %>
    <foo other_attributes enabled= "<%=prompt>"/>
    will throw an error. (to do this you would have to specify rtexpr value of
    this attribute to true)
    For the above to work, your tag should be coded as shown below
    private boolean enabled = false;
    //note rtexpr value will always be Strings
    //container does not provide auto conversions
    public void setEnabled(String enabled) {
         this.enabled = new Boolean(enabled).booleanValue();
    }cheers,
    ram.

  • Variable declaration in the custom tag

    Hey,
    I am using JSP2.0 to write a custom tag. and I need to declare a script variable in my tag so that it can be referenced in a jsp file. At the beginning, I used name-given and my tag works as it supposed to do. But I don't like to make the variable name hard-coded in my tag so that I changed name-given to name-from-attribute as folllows:
    <jsp:directive.variable name-from-attribute="var" alias="local" variable-class="java.util.ArrayList" scope="AT_END"/>
    <jsp:scriptlet>
    out.println(local.getClass().getName());
    </jsp:scriptlet>     
    According to my understanding, variable "local" should be able to be referenced in my tag file and when the tag created in a jsp file
    <tags:myTag var="myTest" />
    the variable myTest should be able to be referenced in this jsp file too. But whenever I try this in jsp: out.println(myTest.getClass().getName());
    I always got this error" myTest cannot be resolved"
    I am totally stuck here. Someone could please give me some hints? thanks a lot!

    Do you have a getter method to match that property?
    Post some example code - what does your tld define for this property, and what get/set methods have you defined for it?

  • Design view for jsp custom tags.

    when we drag-and-drop custom tag control in the source of jsp page, when we switch to the design view of jsp we should be able to view controls as desired.
    Observation: 1) Eclipse 3.2 doesn't have design view for jsp pages.
    2) which software uses the design view. we need to extend eclipse core framework and we do not find any technical approach document to proceed further on this.
    3) RAD 6.0 we can see a JSP in design view.
    I'm searching for any technical approach document to create plugin that can intercept the custom tags and provide a design view.
    Will any one suggest the plugin for that.

    Jeff,
    I have checked with engineering and found that JSP Design View support on
    Linux is a planned feature for the next release. I don't think we will have
    this feature as part of a Service Pack for 8.1
    Regards,
    Raj Alagumalai
    WebLogic Workshop Support
    "Jeff Cassanvoa" <[email protected]> wrote in message
    news:3f4df04e$[email protected]..
    >
    Raj,
    Thanks for the information!! Any timeframe when it might be supportedon Linux
    Thanks,
    Jeff
    "Raj Alagumalai" <[email protected]> wrote:
    Jess,
    Unfortunately, the JSP design view is currently not supported on Linux.
    Workshop does allow to do remote development where the IDE is running
    on a
    Windows machine and connects to a server running on Linux/Solaris.
    Regards,
    Raj Alagumalai
    WebLogic Workshop Support
    "Jeff Cassanova" <[email protected]> wrote in message
    news:[email protected]..
    Does anybody else who is running the Linux version of Workshop 8.1have
    troubling
    getting the Design View of JSP files to come up. All I see is thesource,
    with
    no tabs at the bottom to switch to/from the Design View. When I bootover
    to
    Windows and run 8.1 Workshop, I see both tabs and I am able to useboth
    views.
    Is it something I have set in Preferences somewhere that disablesthe
    Design
    View ???
    Thanks,
    Jeff

  • Custom Tag Attribute not correctly rendered

    Hello,
    I made a custom tag and I want the engine to parse dynamic scripts and evaluate them.
    I call the tag like this :
        <form:toolbaritem id="icon_cancelar" action="javascript:listingAction('<%= request.getContextPath() %>/logout.do');" icon="<%= request.getContextPath() %>/images/toolbar/Cancelar_32.gif"/>The icon and action attributes are declared in the tld like so :
              <attribute>
                   <name>action</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>icon</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>However, the tag is not working with the evaluated expression, receiving "<%= request.getContextPath() %>" instead.
    Any help would be very welcome :) thank you
    Eamerial

    Gotcha........
    First, this is what the jsp spec has to say in sec 1.14.1
    When using scriptlet expressions, the expression must
    appear by itself (multiple expressions, and mixing of expressions and string
    constants are not permitted). Multiple operations must be performed within the
    expression.Simple, isnt it ? All you have to is evaluate the expression as a whole.
    <form:toolbaritem id="icon_cancelar" action="<%="javascript:listingAction('" + request.getContextPath() + "/logout.do;')"%>" icon<%= request.getContextPath() + " /images/toolbar/Cancelar_32.gif " %>"/>cheers,
    ram.

  • Integrating a legacy custom tag with facelets webapp

    Hi
    I have an external custom tag ( a handler that had extended javax.servlet.jsp.tagext.TagSupport ). I am trying to use that custom tag in my .xhtml file(mine is facelets webapp). Please see the xhtml content below
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:tGrid="http://java.pershing.com/tGrid">
    <tGrid:gridFields viewname="view1" isDefault="true" fields="Symbol,Quantity,Security Description,Account Type"/>
    </html>
    The problem here, the tag handler class is not getting invoked, i do not get the HTML content from it.
    I understand like we need to add 'taglib.xml' file as below, and register as config files in servlet context param.
    <tag>
    <tag-name>gridFields </tag-name>
    <handler-class>
    xyz.Grid
    </handler-class>
    </tag>
    I have collected the attributes and kept as TagAttribute in Grid handler class..
    But how could i invoke the custom handler class that had implemented TagSupport and start its own life cycle.
    Please help me out.
    Thanks
    -vijay

    Okay. so we cannot use any legacy custom tags and we need to duplicate the code into a new facelets handler class and add into tablig.xml file. is my understanding correct.?
    By the way, JSTL tags like <c:out> <c:if> are being identified by facelets view handler. How this cud have been supported by it?
    Thanks
    -vijay

  • Using a custom tag with a 2.3 servlet descriptor BUG?

    Hi,
    I just developed a Custom Tag and I'd like to use in my jsps.
    If I add the jsp in my JDev project with the custom tag when I try to build the project I got this error:
    Error(11): oracle.xml.parser.v2.XMLParseException: Invalid element 'listener' in content of 'web-app', expected elements '[context-param, servlet, servlet-mapping, session-config, mime-mapping, welcome-file-list, error-page, taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
    It seems like when the jsp parser encounters the line with taglib it tries to parse the web.xml against a 2.2 version of the dtd. My web.xml begins with the correct dtd version (2.3). Can anyone tell me if this is a bug and eventually tell me how to solve it?
    thanks,
    Giovanni

    I repost this issue again, now with a simple test case.
    If I wrote a simple custom tag:
    import java.io.IOException;
    import javax.servlet.jsp.tagext.TagSupport;
    public class MyCustomTag extends TagSupport {
    public int doStartTag() {
    try {
    pageContext.getOut().print("FOO");
    } catch (IOException ioe) {
    pageContext.getServletContext().log(ioe.getMessage(),ioe);
    return(SKIP_BODY);
    with the associated tld:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.2</jspversion>
    <shortname>try</shortname>
    <uri>try</uri>
    <info>A short description...</info>
    <tag>
    <name>mytag</name>
    <tagclass>MyCustomTag</tagclass>
    <bodycontent>EMPTY</bodycontent>
    </tag>
    </taglib>
    and a jsp using the custom tag:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    The current time is:
    </H2>
    <P>
    <% out.println((new java.util.Date()).toString()); %>
    <%@ taglib uri="try.tld" prefix="try" %>
    <try:mytag />
    </P>
    </BODY>
    </HTML>
    all runs fine if I have a web.xml with the dtd version 2.2
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    but if I use the version 2.3 because I want filters,context listeners and so on:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <filter>
    <filter-name>FilterRedirector</filter-name>
    <filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
    </filter>
    <!-- Filter Redirector URL mapping -->
    <filter-mapping>
    <filter-name>FilterRedirector</filter-name>
    <url-pattern>/FilterRedirector/</url-pattern>
    </filter-mapping>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    I get the error I report in my last post. (the jsp doesn't compile) If I remove the custom tag from my jsp all works fine (filters, listeners,etc). In my project settings I use the 2.3 version of servlet.jar instead of the ServletRuntime that comes with JDeveloper.
    Can anyone tell me how to resolve this issue (Using simple custom tag with a web application using the 2.3 servlet specs)?
    Thanks in advance,
    Giovanni
    If I remove the filter secion all

  • Custom tag with struts

    Hi
    I would like to create a custom tag that will print this section of html with struts:<tr>
         <td class="f_name"><bean:message bundle="fields" key="firstName" /></td>
         <td class="f_value"><html:text property="firstName" /></td>
    </tr>This means that i sould pass to the custom tag the folowing attributes:
    1. bundle - the bundle name to use ("fields").
    2. property - the name of the submitted filed and the key in the bundle resource ("firstName").
    This is how i want to use it:<html:form action="/register.do" enctype="UTF-8">
    <table cellspacing="0" cellpadding="0" border="0" class="t_details">
    <mytld:text bundle="fields" key="firstName"/>
    <mytld:text bundle="fields" key="lastName"/>
    </html:form>For me, this way looks much easier to develop my application/s, don't you agree?
    The problem is that i can't (or i don't know how) to use custom tags in other a custom tag, and if i include a jsp file (with pageContext.indlude("url");), how do i pass the attributes to the jsp page?
    Thanks a lot
    mamtz

    Interesting answer, i'll put it in my mind, but this is not what i ment :) (nice thinking...)
    what i ment was, html:text tag has many attributes like: property, name, alt, size, maxLength and so on...
    i would like sometimes to use size or maxLength and sometimes not.
    take a look at what i wrote:<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%
         String property=""+request.getAttribute("property");
         String bundle=""+request.getAttribute("bundle");
         Object max=request.getAttribute("maxLength");
         String maxLength= max==null ? "" : ""+max;
         Object s=request.getAttribute("size");
         String size= s==null ? "" : ""+s;
    %>
         <tr>
              <td class="f_name"><bean:message bundle="<%=bundle%>" key="<%=property%>" /></td>
    <%     if(max!=null && s!=null){
    %>          <td class="f_value"><html:text property="<%=property%>" maxlength="<%=maxLength%>" size="<%=size%>" /></td>
    <%     }else if(max!=null){
    %>          <td class="f_value"><html:text property="<%=property%>" maxlength="<%=maxLength%>" /></td>
    <%     }else if(s!=null){
    %>          <td class="f_value"><html:text property="<%=property%>" size="<%=size%>" /></td>
    <%     }else{
    %>          <td class="f_value"><html:text property="<%=property%>" /></td>
    <%     }
    %>     </tr>pretty complicated, is'nt it?
    think what would happen if i would like to add just one more attribute...

Maybe you are looking for

  • Problem in SORT statement

    Hi Gurus, I have this problem, I am trying to sort a internal table with the syntax after endselect statement and before read table statement SORT ITAB_SBOOK BY NAME name is a field in the table of type CHAR length 25 in actual table and here is how

  • Command   tab - app windows not at the forefront

    I used to be able to speed through my apps, but now for some reason when I switch to another application, I have to click on the window in order to make it active (i.e. if I copy something from safari and command+tab to word to paste it, I can't just

  • Is there a way to retrieve original iPhone photo after it has been edited and saved?

    I cropped and saved a photo, not realizing the original would be deleted.  Is there any way to retrieve the original?

  • Plz help ! how do i restore songs from another itunes library?

    Okay, yesterday i charged my ipod in my mac laptop and this morning my brother pulled it out. then my ipod would turn on and the wire icon just kept appearing on the screen of my ipod. once i put it in my laptop my ipod froze and the only way any son

  • ACE ACS TACACS+ Key Mismatch issue

    Goodday, I have an issue when trying to setup ACE Modules for TACACS+ and AAA autentication whereby the Failed Authentication reports, state the reason as "Key Mismath". We have confirmed that the key we are using is the same on the ACE and on the AC