SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 122 | Next

Larry Brown, Marty Hall, and Yaakov Chaikin

"Core Servlets and JavaServer Pages, Volume 2"

Listing 2.24 shows an excerpt from
the web.xml file. The excerpt indicates that the configurations will apply to all files
located in the /WEB-INF/jspPages/ustm directory. In this configuration we are
instructing the server to include a header and a footer with every resource served
from that directory. Listings 2.25 and 2.26 show the complete code for USTMHeader.
jsp and USTMFooter.jsp, respectively. Listing 2.27 shows the complete code
for the target of our configuration, USTMBody.jsp, which is located in the /WEB-INF/
jspPages/ustm directory. Note that USTMHeader.jsp, USTMBody. jsp, and USTMFooter.
jsp do not produce valid HTML code by themselves. Each one is a snippet of
code that only makes sense in the context of all three, and only in the proper order??”
USTMHeader.jsp, USTMBody.jsp, and then USTMFooter.jsp. Figure 2??“22 shows the
result of the custom mapped URL invoking the USTMBody.jsp page. Also note that
because we configured JSP EL to be ignored, ${money} is interpreted as regular
text. Finally, Listing 2.28 shows the generated HTML code as the result of our
invocation.
Chapter 2 ?–  Controlling Web Application Behavior with web.xml 90
Listing 2.24 web.xml (Excerpt showing jsp-property-group)

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.


Pages:
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134