Java 2EE and XML Development

Скачать в pdf «Java 2EE and XML Development»


Listing 5.7 The British English WML watch list JSP

<jsp:useBean name=»helper» scope=»page»


<%@ taglib uri=»example.tld» prefix=»helperTag» %>


<card id=»main» title=»Your Watch List»>

<do type=»accept» name=»do-back» label=»Back»>

<go href=»» />


<do type=»accept» name=»do-buy» label=»Buy Shares»>

<go href=»» /> </do>

<do type=»accept» name=»do-sell» label=»Sell Shares»> <go href=»» /> </do>

<p><b>Greetings, Mr.

<jsp:getProperty name=»helper» property=»lastName»/>! </b></p>

<p>Here are the latest prices on your stocks of interest.</p> <table columns=»3″>

<helperTag:printData useLinks=»no» currency=»GBP»/>




5.2.4    Analyzing the results

We think you will admit that building a multidevice, multilocale presentation layer in J2EE is not easy. Imagine how much worse things could have been if we had chosen some less-complimentary output formats or wildly different locales. Also consider how much effort would be involved in extending our example code to accommodate more languages, locales, or device types.

This is the area in which an XML-based presentation layer can come to the rescue to some extent. While serving substantially different views of the same application is always challenging, some XML tools have recently emerged to make the process a bit easier for you. That is, after you learn to use them.

5.3    The J2EE/XML approach

The first XML architectural alternative we examine involves the combined use of XSLT with the J2EE presentation comp
onents. In chapter 2, we talked briefly about what XSLT is and how to use it via JAXP. You will recall that XSLT provides a general way to transform XML into virtually any output format. This comes in very handy when generating thin-client user interfaces like the one we have been working with in our example.

Скачать в pdf «Java 2EE and XML Development»