I don't think you're mistaken Dallas.  I just updated to last night's build
and now none of my <html:image/> tags create valid html.  They all look like
this:
<input type="image" name="next src="next.gif">

Looking back in the CVS log, Craig did some work on this code on 2/19 to
look up alternate text in a message resources bundle.  I think he may have
missed a line (even our heroes aren't perfect).

Jason Haase


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: RE: Beta 1 image tag bug



I don't think the lack of an ending tag is what Denis was talking about.
The <html:image/> tag is missing a double quote (the closing one) for the
"name" property.
The problem (to my very inexperienced eyes) appears to be in ImageTag:
public class ImageTag extends SubmitTag {
....
public int doEndTag() throws JspException {
        .....
        results.append("<input type=\"image\" name=\"");
        results.append(property);
        [I think there needs to be a "results.append("\"");" right here,
but there isn't one]
        tmp = src();
        ...

Forgive me if I'm completely mistaken on this one.

-Dallas Browning



 

                    Tom

                    Maccariella          To:
"'[EMAIL PROTECTED]'"                             
                    <tmacc@sengen        <[EMAIL PROTECTED]>

                    .com>                cc:

                                         Fax to:

                    02/26/01             Subject:     RE: Beta 1 image tag
bug                                  
                    11:33 AM

                    Please

                    respond to

                    struts-user

 

 





In the HTML spec, there are many tags which don't require an ending tag.
The <input> tag is one such element.  The XML-like self-closing tag is not
part of the HTML spec.  I've seen a lot of this with struts and other tools
which use XML.  Another example is the <br> tag which is often improperly
specified as <br/>. Since it doesn't have an associated end tag, page
authors often mistakingly specify this tag as <br/>.  There are many more
examples.

So, the way Struts does this via <html:image/> is correct.

-Tom
Tom Maccariella
Sengen


-----Original Message-----
From: Denis Hanson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 11:27 AM
To: Struts-User
Subject: Beta 1 image tag bug



I just converted my project to the Beta 1 version of struts and encountered
a problem with the <html:image/> tag.  The image tag appears to be eating
the closing quote on the property (name) attribute.  The <html:image/> code
worked fine with struts.jar from 2/21.


Here's some test jsp code:

<td colspan=4 align=center>
   <html:image property="Logon" src='<%=ip+"images/btnLogon.gif"%>'/>
   <input type="image" name="Logon" src='<%=ip+"images/btnLogon.gif"%>'
border="0">
</td>

And here's the output html:

<td colspan=4 align=center>
  <input type="image" name="Logon src="en/images/btnLogon.gif">  <--- no
closing quote
  <input type="image" name="Logon" src='en/images/btnLogon.gif' border="0">
</td>

Thanks,

Denis Hanson



Reply via email to