Learn Java for Web Development

(Tina Meador) #1
CHAPTER 3: Best Practices in Java EE Web Development 117

14./book
15.
16.
17.index.html
18.

19.


Now the only key component that is missing in this web application is the JSP page, which is where
the EL code is actually written. Before we get to the JSP page, we will look at the two key operators
provided by EL to access encapsulated data: the [ ] and. (also called dot) operators. After
learning about the [ ] and. operators, you will be able to write book.jsp. Figure 3-6 illustrates the
directory structure of the application.


Figure 3-6. Directory structure


The [ ] and. Operators


Using the. notation is shortcut for accessing an object’s property. The dot operator was introduced
in Listing 3-5. For the sake of convenience, it is shown again in Listing 3-13.


Listing 3-13. Using the Dot Operator


1.
2.User is: ${user.name}

Free download pdf