• Post Reply Bookmark Topic Watch Topic
  • New Topic

PetStore cart.jsp question  RSS feed

 
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
Posts: 66149
146
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!