DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5785>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5785

XML request time attribute not generated correctly

           Summary: XML request time attribute not generated correctly
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Example JSP: converted and modified from foo.jsp in the examples/jsp/simpletag
directory.

<jsp:root
  xmlns:jsp="http://java.sun.com/JSP/Page";
  xmlns:eg="http://jakarta.apache.org/tomcat/examples-taglib";
  version="1.2">

<html>
<body>

Radio stations that rock:

<ul>
<eg:foo att1="98.5" att2="92.3" att3="107.7">
<form action="%= member %"/>
<li><jsp:expression>member</jsp:expression></li>
</eg:foo>
</ul>
</body>
</html>
</jsp:root>


The <jsp:expression> is generated okay. But the request-time expression in the
action attribute is not.

It seems if a tag is considered 'uninterpreted', then the attributes are simply
output to the servlet writer.

Possible fix:

diff -C 5
tomcat/src/jasper/src/share/org/apache/jasper/compiler/UninterpretedTagBeginGenerator.java
jakarta-tomcat-4.0.1-src/jasper/src/share/org/apache/jasper/compiler/UninterpretedTagBeginGenerator.java
***
tomcat/src/jasper/src/share/org/apache/jasper/compiler/UninterpretedTagBeginGenerator.java
   Mon Jan  7 16:35:34 2002
---
jakarta-tomcat-4.0.1-src/jasper/src/share/org/apache/jasper/compiler/UninterpretedTagBeginGenerator.java
   Sun Oct 14 12:14:32 2001
***************
*** 102,121 ****
          String quote = doubleQuote;
                  String name = attrs.getQName(i);
                  String value = attrs.getValue(i);
          if (value.indexOf('"') != -1) quote = singleQuote;
                  sb.append("  ").append(name).append("=").append(quote);
!                                 if (JspUtil.isExpression(value, true)) 
!                                 {
!                                     sb.append("\");");
!                                     sb.append("out.print(" + new
String(JspUtil.escapeXml(JspUtil.getExpr(value, true))) + ");");
!                                     sb.append("out.write(\"").append(quote);
!                                 }
!                                 else
!                                 {
!                                     sb.append(value).append(quote);
!                                 }
              }
              sb.append(">");
          }
      writer.print(sb.toString());
          writer.print("\");");
--- 102,112 ----
          String quote = doubleQuote;
                  String name = attrs.getQName(i);
                  String value = attrs.getValue(i);
          if (value.indexOf('"') != -1) quote = singleQuote;
                  sb.append("  ").append(name).append("=").append(quote);
!         sb.append(value).append(quote);
              }
              sb.append(">");
          }
      writer.print(sb.toString());
          writer.print("\");");

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to