Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
The technology also supports languages that facilitate the rapid creation of XML content. In this month's installment of this series, I will explain how to represent different types of data in XML while still supporting those applications that lack XML ability. I will apply XML to three example applications' data: detailed realtime weather data, stock data, and data from other applications or devices. In addition, I will demonstrate how to use other languages, such as Python and Tcl scripting, with the Brazil Web server. This article will focus on XML generation, with future articles covering XML consumption.
Read the whole series on Brazil technology:
Numerous Webpages combine formatting and data. One of the primary benefits of XML is that it facilitates the separation of data from the formatting of that data. Good Web applications will support XML while providing support for those that don't.
Let's begin with a small example that demonstrates the coupling of data with formatting. Let's say we're interested in the collection and display of weather data. To make the temperature bold in an HTML table, we could write the following code:
<td>Temperature <bold>76,5 </bold> </td>
To generate the page, eventually the data and code must be combined. For example, the above code segment could be realized in BSL by the following:
<td>Temperature <bold> <property temperature> </bold> </td>
Listing 1. Combine data and formatting in HTML via the typical approach
If you need to place the temperature on a page, the above approach is much easier than creating HTML each time by generating
the content with a procedural programming language that requires recompilation for simple changes. You also don't have to
search for a location for the temperature; simply put the <property ws.sample.Temperature> tag anywhere on the HTML page where you would like realtime weather data, and the Brazil technology will rewrite the page
so that it will display the data when a browser displays it.
In prior articles, I configured the Brazil Web server to interface with a realtime weather station and provide Web data in the typical manner -- content plus data together -- as shown in Listing 1. For display to users, this approach is suitable, but more and more new Web applications consist of data from multiple Websites. Requiring developers that work on these new types of applications to parse HTML can lead to complications. To create a new service, developers would have to parse the data to obtain the weather information from site A to combine with site C's data. A process that separates the formatting from the content would solve these complications.
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq