tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51490] New: if.jsp has many bugs and c:if example not useful
Date Fri, 08 Jul 2011 18:05:44 GMT

             Bug #: 51490
           Summary: if.jsp has many bugs and c:if example not useful
           Product: Tomcat 7
           Version: 7.0.16
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Examples
    Classification: Unclassified

Created attachment 27276
Three versions of the "if" example, including a fix.


Small things:
 * Has unclosed font tags and hr tags (old HTML)
 * Has doubled font tags: "<font <font" (broken)
 * Uses "</br>" sometimes (broken) - should be "<br/>" always

Medium thing:
 * The content in the following prints even when it's not working!  E.g., if
the jstl.jar is not there!
    <c:if test="${2>0}">
        It's true that (2>0)!
The User Agent simply prints the content of the unknown tag.

Please add after this:
    <c:if test="${0>2}">
      If you see this, then (0>2)! Fail!

Major things:
 * Must use the old non-XML syntax with .jsp file suffix:
      <%@ taglib uri="" prefix="c" %>
 * The scope for "theTruth" should be "page" to avoid testing issues.

If the taglib line is removed and the following is added to the <html> tag:
then the example does NOT work, even though it might look like it does!
In this case, "theTruth" is still set from if.jsp (if scope="session") and the
contents of the c:if tag still appear, even with no JSTL processing.

To use xmlns:c rather than the taglib line, the developer must
1) Switch to the .jspx file suffix
2) Use the jsp:root element
3) Or configure Tomcat to treat .jsp as XML

The above is not clear, especially when the example appears to work in many
cases when it should not.

I have attached:
1) A fixed if.jsp - please use this.
2) An if.jspx version - please include this for contrast.
3) An if-xmlns.jsp version that does NOT work, but appears to work if if.jsp is
visited first.  This is to test the example.


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message