[ Team LiB ] Previous Section Next Section


The Workshop is designed to help you review what you have learned, and help you to further increase your understanding of the material covered in this hour.



Name two ways to represent a string in a JSP EL expression contained with an attribute value.


Where does JSP EL look for variables?


What's the difference between order.price and order["price"]?



You can use different quotation marks, such as value='${fn:length("hello")}', or you can use \ to escape the quotes, such as value="${fn:length(\"hello\")}".


It looks in the variable scopes, starting at the page scope and proceeding through the request, session, and application scopes, using the first variable it finds


There is no difference. The only time there might be a difference is if you are accessing a member of a map with an odd-looking key like "a+b". In this case, the syntax "order.a+b" would be interpreted as "access attribute a of order and then add it to b", instead of "access attribute a+b of order."


Use a scriptlet to store some values in the request and session scopes, then use the <jsp:text> tag to write JSP EL expressions that manipulate those values. Remember that you can use JSP EL expressions within the body text of the <jsp:text> tag.

    [ Team LiB ] Previous Section Next Section