Database Reference
In-Depth Information
Which Technology to Use?
Somewhat confusing perhaps is that eXist has two very different technologies for
mapping URLs in HTTP requests to functionality (e.g., executing XQuery or XSLT
code or retrieving a particular resource). They are URL rewriting and RESTXQ :
• URL rewriting works by intercepting every HTTP request and passing it first
through a centralized controller XQuery script that you provide. This script
decides what to do with the request and either passes it on to another specific
XQuery script, performs a redirect, or rejects it. Read more about this in “URL
Mapping Using URL Rewriting” on page 194 .
• RESTXQ works with XQuery 3.0 function annotations that tell eXist the function
that must be executed when certain HTTP requests come along. Read more
about this in “Building Applications with RESTXQ” on page 215 .
URL rewriting is the older and more mature of the two. RESTXQ is younger and eas‐
ier to use, but might not provide all the necessary functionality yet. The approaches
cannot be mixed!
So, which one to choose? RESTXQ is probably the simpler approach to get started
with, and also the more platform-independent choice. However, there are some limi‐
tations in RESTXQ at the moment:
• RESTXQ allows little nondeclarative access to the HTTP request: the eXist HTTP
request module is not supported.
• RESTXQ has no session (in other words, the eXist session module is not sup‐
ported).
• There is no support for processing HTTP multipart requests or responses in
RESTXQ.
Therefore, you can handle more advanced tasks with URL rewriting (currently).
However, few people need such advanced functionality, and missing features are
likely to be added to RESTXQ in the near future.
Application Aspects
A web application is a multifaceted thing, and there are many aspects you have to
deal with to make everything run smoothly. This is the case for all web technologies,
and eXist is no exception. What are the eXist-specific aspects we have to talk about?
In this chapter, we'll explore the following topics:
Where to store your files/resources
Older versions of eXist gave you the choice of storing the application's files/
resources in the database or on the filesystem. Although the option of using the
Search WWH ::




Custom Search