Examples of makeReply()


Examples of org.w3c.jigsaw.http.Request.makeReply()

             target));
    }
      }
      request.setInternal(true);
  } catch (MalformedURLException ex) {
      Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      error.setContent("<html><head><title>Server Error</title>"+
           "</head><body><h1>Server misconfigured</h1>"+
           "<p>The resource <b>"+getIdentifier()+"</b>"+
           "has an invalid target attribute : <p><b>"+
           getTarget()+"</b></body></html>");     
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

    }
    if ( count >= limit ) {
        String msg = "Simultaneous number of access to this page "
      + "is limited to " + limit + " you was not able to "
      + "get in." ;
        Reply error = request.makeReply(HTTP.SERVICE_UNAVAILABLE);
        error.setContent (msg) ;
        throw new HTTPException (error) ;
    }
      } else {
    try {
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

    {
  Request request = (Request) req;
  int limit = getLimit();

  if (request.getURL().toExternalForm().length() > limit) {
      Reply error = request.makeReply(HTTP.REQUEST_URI_TOO_LONG);
      HtmlGenerator g = new HtmlGenerator("Request URI Too Long");
      g.append ("Your request should have an URI of less than " +
          limit + " bytes");
      error.setStream(g);
      return error;
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

  Request request = (Request) req;
  PipedInputStream pis = null;

  if (wrapper == null) {
      Reply reply = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      reply.setContent("Servlet Wrapper Frame not configured properly: "+
           "must be attached to a ServletWrapper.");
      throw new HTTPException(reply);
  }
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

  }

  try {
      wrapper.checkServlet();
  } catch (ClassNotFoundException ex) {
      Reply reply = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      reply.setContent("The server was unable to find the "+
           "servlet class : "+ex.getMessage());
      if ( wrapper.debug )
    ex.printStackTrace();
      throw new HTTPException(reply);
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

           "servlet class : "+ex.getMessage());
      if ( wrapper.debug )
    ex.printStackTrace();
      throw new HTTPException(reply);
  } catch (ServletException ex) {
      Reply reply = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      reply.setContent("The server was unable to initialize the "+
           "servlet : "+ex.getMessage());
      if ( wrapper.debug )
    ex.printStackTrace();
      throw new HTTPException(reply);
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

      throw new HTTPException(reply);
  }

  // Check that the servlet has been initialized properly:
  if ( ! wrapper.isInited() ) {
      Reply reply = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      reply.setContent("Servlet not configured properly");
      throw new HTTPException(reply);
  }
  // Dispatch the request:
  Reply reply = createDefaultReply(request, HTTP.OK);
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

      o.wait();
        }
    }
      }
  } catch (UnavailableException uex) {
       reply = request.makeReply(HTTP.SERVICE_UNAVAILABLE);
       if (uex.isPermanent()) {
     reply.setContent("<h2>The servlet is permanently "+
          "unavailable :</h2>"+
          "Details: <b>"+uex.getMessage()+"</b>");
       } else {
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

     } catch (IOException ioex) {}
       }
  } catch (Exception ex) {
      if ( wrapper.debug )
    ex.printStackTrace();
      reply = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      reply.setContent("Servlet has thrown exception:" + ex.toString());
      if (pis != null) {
    try {
        pis.close();
    } catch (IOException ioex) {}
View Full Code Here

Examples of org.w3c.jigsaw.http.Request.makeReply()

  Reply reply = null;
  try {
      reply = (Reply) server.perform(req);
  } catch (ResourceException ex) {
      reply = req.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      reply.setContent(ex.getMessage());
  } catch (ProtocolException pex) {
      if (pex.hasReply())
    reply = (Reply) pex.getReply();
      else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.