Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PetStore cart.jsp question

 
Peter Lee
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,
Referring to Petstore 1.3.2 source code cart.jsp, why in following line 5, it can refer to cart directly without declaring cart before?
1: <%@ taglib prefix="waf" uri="/WEB-INF/waftags.tld" %>
2: <%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
3: <%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld" %>
4: <c:choose>
5: <c:when test="${cart.count == 0}">
6: <p class="petstore_title">Your Shopping Cart is Empty.</p>
7: </c:when>
Thanks.
Regards,
Peter
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the EL, an unqualified name, such as cart in this example, is expected to be a scoped variable in one of page, request, session or application scopes. Because there is no qualification, the EL will search the scopes for "cart" in that order.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic