Package org.exist.http.servlets

Examples of org.exist.http.servlets.HttpRequestWrapper


     */
    private void declareVariables(XQueryContext context, HttpServletRequest request, HttpServletResponse response) throws XPathException
    {
      if(request != null)
      {
        final RequestWrapper reqw = new HttpRequestWrapper(request, formEncoding, containerEncoding);
          context.declareVariable(RequestModule.PREFIX + ":request", reqw);
          context.declareVariable(SessionModule.PREFIX + ":session", reqw.getSession( false ));
      }
       
      if(response != null)
      {
        final ResponseWrapper respw = new HttpResponseWrapper(response);
View Full Code Here


     */
    private HttpRequestWrapper declareVariables(final XQueryContext context,
        final ElementImpl variables, final HttpServletRequest request,
        final HttpServletResponse response) throws XPathException {

        final HttpRequestWrapper reqw = new HttpRequestWrapper(request, formEncoding, containerEncoding);
        final ResponseWrapper respw = new HttpResponseWrapper(response);

        // context.declareNamespace(RequestModule.PREFIX,
        // RequestModule.NAMESPACE_URI);
        context.declareVariable(RequestModule.PREFIX + ":request", reqw);
        context.declareVariable(ResponseModule.PREFIX + ":response", respw);
        context.declareVariable(SessionModule.PREFIX + ":session", reqw.getSession(false));

        //enable EXQuery Request Module (if present)
        try {
            if(xqueryContextExqueryRequestAttribute != null && cstrHttpServletRequestAdapter != null) {
                final Object exqueryRequestAdapter = cstrHttpServletRequestAdapter.newInstance(request, new FilterInputStreamCacheConfiguration(){
View Full Code Here

                resource.getCollection().getURI()).toString());

        context.setStaticallyKnownDocuments(
                new XmldbURI[]{resource.getCollection().getURI()});

        final HttpRequestWrapper reqw = declareVariables(context, null, request, response);
        reqw.setServletPath(servletPath);
        reqw.setPathInfo(pathInfo);

        if (compiled == null) {
            try {
                compiled = xquery.compile(context, source);
            } catch (final IOException e) {
View Full Code Here

                resource.getCollection().getURI()).toString());

        context.setStaticallyKnownDocuments(
                new XmldbURI[]{resource.getCollection().getURI()});

        final HttpRequestWrapper reqw = declareVariables(context, null, request, response);
        reqw.setServletPath(servletPath);
        reqw.setPathInfo(pathInfo);
        if (compiled == null) {
            try {
                compiled = xquery.compile(context, source);
            } catch (final IOException e) {
                throw new BadRequestException("Failed to read query from "
View Full Code Here

            final Serializer serializer = broker.getSerializer();
            serializer.reset();

            //setup the http context
            final HttpContext httpContext = serializer.new HttpContext();
            final HttpRequestWrapper reqw = new HttpRequestWrapper(request, formEncoding, containerEncoding);
            httpContext.setRequest(reqw);
            httpContext.setSession(reqw.getSession(false));
            serializer.setHttpContext(httpContext);


            // Serialize the document
            try {
View Full Code Here

  private void declareVariables(XQueryContext context,
      HttpServletRequest request, HttpServletResponse response)
      throws XPathException {
   
    final RequestWrapper reqw = new HttpRequestWrapper(
        request,
        request.getCharacterEncoding(), request.getCharacterEncoding());
   
    final ResponseWrapper respw = new HttpResponseWrapper(response);
    // context.declareNamespace(RequestModule.PREFIX,
    // RequestModule.NAMESPACE_URI);
    context.declareVariable(RequestModule.PREFIX + ":request", reqw);
    context.declareVariable(ResponseModule.PREFIX + ":response", respw);
    context.declareVariable(SessionModule.PREFIX + ":session", reqw.getSession(false));
  }
View Full Code Here

    }

    private void declareVariables(XQueryContext context, SourceInfo sourceInfo, URLRewrite staticRewrite, String basePath,
      RequestWrapper request, HttpServletResponse response)
      throws XPathException {
    final HttpRequestWrapper reqw = new HttpRequestWrapper(request, "UTF-8", "UTF-8", false);
    final HttpResponseWrapper respw = new HttpResponseWrapper(response);
    // context.declareNamespace(RequestModule.PREFIX,
    // RequestModule.NAMESPACE_URI);
    context.declareVariable(RequestModule.PREFIX + ":request", reqw);
    context.declareVariable(ResponseModule.PREFIX + ":response", respw);
    context.declareVariable(SessionModule.PREFIX + ":session", reqw.getSession( false ));

        context.declareVariable("exist:controller", sourceInfo.controllerPath);
        request.setAttribute("$exist:controller", sourceInfo.controllerPath);
        context.declareVariable("exist:root", basePath);
        request.setAttribute("$exist:root", basePath);
View Full Code Here

TOP

Related Classes of org.exist.http.servlets.HttpRequestWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.