This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes PetStore cart.jsp question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "PetStore cart.jsp question" Watch "PetStore cart.jsp question" New topic
Author

PetStore cart.jsp question

Peter Lee
Greenhorn

Joined: Jun 25, 2003
Posts: 24
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

Joined: Jan 10, 2002
Posts: 60738
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PetStore cart.jsp question
 
Similar Threads
Internationalization of Struts program
Struts within an existing application
tag libs
taglibs migrated from tomcat3.2 to 4.1
Problem with a simple struts application