Database Reference
In-Depth Information
global parameter $xslt.extra . Not all XDM types are supported, so it's best to
limit yourself to strings.
Changing the URL for URL Rewriting
We've only seen ugly URLs for referencing our application so far, like:
http://localhost:8080/exist/rest/db/myapp/
For a resource stored in the database underneath /db/myapp
http://localhost:8080/exist/apps/building-applications/
For an application with a URL rewriting controller stored in the database under‐
neath /db/apps/myapp
It's time to clean up our act and make way for nice URLs like http://localhost/myapp
that use port 80 and don't need the /exist prefix—or even better, use a DNS name like
http://www.myapp.com/ .
Changing the URL has everything to do with how eXist processes a URL:
• The Jetty web server is the main receiver of the request. It listens on a certain
TCP port (by default, 8080) for HTTP requests. It examines the request and,
based on its URL, passes it on to a servlet. The default configuration tells Jetty
that all requests (with a URL starting with /exist ) should be passed to the
XQueryUrlRewrite servlet, serving as the central entry point.
• The XQueryUrlRewrite servlet matches the remainder of the URL (the part
after /exist ) to entries in the mapping file $EXIST_HOME/webapp/WEB-INF/
controller-config.xml . This tells XQueryUrlRewrite what to do: look for a URL
rewriting controller somewhere or pass it directly to another servlet.
• If a URL rewriting controller is involved, it inspects the URL and passes control
for further processing (or tells the browser to redirect to another page).
We talked about this last step first (see “URL Mapping Using URL Rewriting” on
page 194 ), because it's so crucial for understanding how applications work in eXist.
Now we're going to talk about the first two stages.
Changing Jetty Settings: Port Number and URL Prefix
The Jetty settings determine the TCP port number used (by default, 8080) and the
prefix of the URL (by default, /exist ). These settings are configured in
$EXIST_HOME/tools/jetty/etc/jetty.xml .
Change TCP port number
To change the TCP port number eXist listens on, find the following entries,
change the port numbers, and restart eXist:
Search WWH ::




Custom Search