Home arrow SOAP & Web Services arrow Page 8 - Dynamic Data Analysis on the Web-a Design Approach

Use of JavaBeans to provide dynamic values - Web Services

Learn about an adaptable approach which separates programming tasks from Web page design tasks. This strong conceptual model encourages good design, enables re-use of data definitions, and is well-suited to the construction of dynamic user interfaces. The authors also illustrate the particular challenges you might encounter when you dynamically change the analysis performed by Web pages. (This intermediate-level article was first published by IBM developerWorks, August 5, 2004, at http://www.ibm.com/developerWorks).

TABLE OF CONTENTS:
  1. Dynamic Data Analysis on the Web-a Design Approach
  2. Data analysis concepts
  3. Dimensions and measures
  4. Filtering and ordering
  5. Dimension, measure, and slice dimension tags
  6. Presenting data
  7. Value formatting tags
  8. Use of JavaBeans to provide dynamic values
  9. Reporting common errors
  10. Tag containment
  11. Custom tags: lightweight, cheap, replaceable
  12. Benefits of this design approach
  13. In conclusion
By: developerWorks
Rating: starstarstarstarstar / 15
December 29, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

A common way to transfer information within and between JSPs is by using JavaBeans. Bean attribute values might be set using HTML form submission, or a variety of other means. Once set, those attribute values can be used to control aspects of the data-related tags.

Listing 4. Controlling filtering using a JavaBean


<%@ taglib uri="/WEB-INF/tlds/dd.tld" prefix="dd" %>
<jsp:useBean class="package.beanClass" id="salesChoices" scope="page"/%>

<dd:data id="sales">
  ...
  <dd:filters>
    <dd:includeFilter>
      <dd:dimension>Sales Region</dd:dimension>
      <dd:value
        ><jsp:getProperty name="salesChoices" property="region"/>
      </dd:value>
    </dd:includeFilter>
  </dd:filters>
</dd:data>

In Listing 4, a JavaBean is given an id of salesChoices and given page scope. This bean might support a number of properties that have been set by various means, but in this case, we assume that the region attribute has been set by user input using an HTML form control. The includeFilter tag filters on the sales region dimension, and the value to be included is taken from the region attribute of our salesChoices bean.

Populating form fields with dynamic values

To make the example shown in Listing 4, the page author will need to construct a page where the user can select the region from a list of current regions. The page author might choose to hard code a set of known sales region values. This is an acceptable strategy if the set of valid sales regions is fixed. However, if the list of current regions is volatile, or the list of regions that will be returned in the data varies according to other selections, the page author will wish to present the user with region choices that reflect the current state.

To meet this requirement, provide custom JSP tags can that produce HTML form controls populated with the appropriate values. You can obtain these values from the data source by leveraging the existing data definition.



 
 
>>> More SOAP & Web Services Articles          >>> More By developerWorks
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SOAP & WEB SERVICES ARTICLES

- Google Play Launched to Revive Brand
- Google Releases Preview of its Cloud SQL Ser...
- Microsoft and Amazon Team Up for the Cloud
- GoDaddy Joining the Cloud
- Amazon EBS Outage Challenges Cloud Supporters
- Dynamic Data Analysis on the Web-a Design Ap...
- Use collection types with SOAP and JAX-RPC
- Blogging Away To Glory (A bBlog Primer)
- Introduction to Service Oriented Architectur...
- Connecting Smart Devices on the Internet
- An Embeddable Standards Compliant Web Servic...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: