Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

AjaXQuery

Using Ajax with XQuery In Web applications

Brian M. Carey, Information Systems Consultant, Triangle Information Solutions
Photo of Brian Carey
Brian Carey is an information systems consultant who specializes in the architecture, design, and implementation of Java enterprise applications. You can follow Brian on Twitter at http://twitter.com/brianmcarey, and his tweets are publicly available.

Summary:  Discover how you can get the full benefit of using XQuery technology together with Asynchronous JavaScript and XML (Ajax). Your Web application will have the back-end benefit of sophisticated XML querying as well as the client-side benefit of rich presentation without the distraction of repeated requests.

Date:  07 Jul 2009
Level:  Intermediate PDF:  A4 and Letter (373 KB | 26 pages)Get Adobe® Reader®

Activity:  12124 views
Comments:  

Before you start

Discover what you need to get the most from this tutorial.

About this tutorial

Ajax is an acronym for Asynchronous JavaScript + XML. XQuery is a technology used to query Extensible Markup Language (XML) documents. Together, these technologies provide a powerful means of creating rich Web applications that facilitate client-side dynamic content derived from XML document queries—an excellent solution for applications that require data access against an XML document as opposed to a relational database. And, because XML is quickly becoming the generally accepted means of information interchange (especially when platform independence is required), the necessity of querying against XML to present information in a Web application is growing in popularity. A Web application implementation that uses Ajax together with XQuery can enable complex queries against data stored in an XML format and cleanly present the information to the user.

This tutorial explains how to create a Web application—called FishinHole.com—that uses these two powerful technologies together. The Web application uses Java™ enterprise technology with the popular Spring framework. You also use DataDirect's XQuery application programming interface (API), or XQJ, for XQuery purposes. Finally, you deploy the application to an Apache Tomcat server. You can then access the application with a standard Web browser and see the benefits of using XQuery with Ajax.


Objectives

In this tutorial, you first learn a bit about XQuery—what it is and how it works. Next, you learn about Ajax and its place in Web applications. The requirements for the sample Web application are established, and the tutorial guides you through the process of creating a "basic" Web application using Spring. You also create a basic Web application that does not use Ajax and XQuery, which will enable you to see how things work without XQuery and Ajax so that you can understand the advantages of using these technologies together. Finally, you're guided through the process of modifying the Web application to use Ajax and XQuery.


Prerequisites

To use this tutorial, you should have a basic understanding of Web application development and deployment as well as a basic understanding of the Java programming language, XML, HTML, and the JavaScript language. Ideally, you should also understand Tomcat server administration.


System requirements

To run the examples in this tutorial, you need a platform that can support the Apache Tomcat application server. The tutorial assumes that the server will run on a Microsoft® Windows® platform, but UNIX®-savvy users will certainly be able to make the appropriate adjustments to enable implementation on that platform, as well.

You also need the Spring framework, as that is the tool that you use to implement the Model-View-Controller (MVC) pattern in the Web application. This framework is also used for dependency injection.

Finally, you must have the XQJ library. This is the API that the application uses to actually perform the XQuery processing.

1 of 9 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Web development
ArticleID=406743
TutorialTitle=AjaXQuery
publish-date=07072009
author1-email=careyb@triangleinformationsolutions.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.