## org.exist.http.servlets
Class XQueryServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.exist.http.servlets.XQueryServlet

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class XQueryServlet
extends javax.servlet.http.HttpServlet

Servlet to generate HTML output from an XQuery file. The servlet responds to an URL pattern as specified in the WEB-INF/web.xml configuration file of the application. It will interpret the path with which it is called as leading to a valid XQuery file. The XQuery file is loaded, compiled and executed. Any output of the script is sent back to the client. The servlet accepts the following initialization parameters in web.xml:

user | The user identity with which the script is executed.
password | Password for the user.
uri | A valid XML:DB URI leading to the root collection used to process the request.
encoding | The character encoding used for XQuery files.
container-encoding | The character encoding used by the servlet container.
form-encoding | The character encoding used by parameters posted from HTML forms.

User identity and password may also be specified through the HTTP session attributes "user" and "password". These attributes will overwrite any other settings.

Author:
  Wolfgang Meier (wolfgang@exist-db.org)
See Also:
  Serialized Form

Field Summary
`static java.lang.String` `DEFAULT_CONTENT_TYPE`
`static java.lang.String` `DEFAULT_ENCODING`
`static java.lang.String` `DEFAULT_PASS`
`static XmldbURI` `DEFAULT_URI`
`static java.lang.String` `DEFAULT_USER`
`static java.lang.String` `DRIVER`

Constructor Summary
`XQueryServlet()`

Method Summary
`void` `init(javax.servlet.ServletConfig config)`

Methods inherited from class javax.servlet.http.HttpServlet
`service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_USER

    public static final java.lang.String DEFAULT_USER

See Also:
  Constant Field Values

### DEFAULT_PASS

    public static final java.lang.String DEFAULT_PASS

See Also:
  Constant Field Values

### DEFAULT_URI

    public static final XmldbURI DEFAULT_URI

### DEFAULT_ENCODING

    public static final java.lang.String DEFAULT_ENCODING

See Also:
  Constant Field Values

### DEFAULT_CONTENT_TYPE

    public static final java.lang.String DEFAULT_CONTENT_TYPE

See Also:
  Constant Field Values

### DRIVER

    public static final java.lang.String DRIVER

See Also:
  Constant Field Values

Constructor Detail

### XQueryServlet

    public XQueryServlet()

Method Detail

### init

    public void init(javax.servlet.ServletConfig config)
              throws javax.servlet.ServletException

  Throws:
    `javax.servlet.ServletException`

Copyright (C) Wolfgang Meier. All rights reserved.