org.exist.http.servlets
Class XQueryServlet

java.lang.Object
  extended byHttpServlet
      extended byorg.exist.http.servlets.XQueryServlet

public class XQueryServlet
extends 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:

userThe user identity with which the script is executed.
passwordPassword for the user.
uriA valid XML:DB URI leading to the root collection used to process the request.
encodingThe character encoding used for XQuery files.
container-encodingThe character encoding used by the servlet container.
form-encodingThe 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 java.lang.String DEFAULT_URI
           
static java.lang.String DEFAULT_USER
           
static java.lang.String DRIVER
           
 
Constructor Summary
XQueryServlet()
           
 
Method Summary
protected  void doGet(HttpServletRequest request, HttpServletResponse response)
           
protected  void doPost(HttpServletRequest request, HttpServletResponse response)
           
 void init(ServletConfig config)
           
protected  void process(HttpServletRequest request, HttpServletResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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 java.lang.String DEFAULT_URI
See Also:
Constant Field Values

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(ServletConfig config)
          throws ServletException
Throws:
ServletException

doGet

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     java.io.IOException
Throws:
ServletException
java.io.IOException

doPost

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response)
               throws ServletException,
                      java.io.IOException
Throws:
ServletException
java.io.IOException

process

protected void process(HttpServletRequest request,
                       HttpServletResponse response)
                throws ServletException,
                       java.io.IOException
Throws:
ServletException
java.io.IOException


<oXygen/> XML Editor provides support for editing and debugging XQuery expressions against the eXist XML Database.