Package jeeves.server.sources

Examples of jeeves.server.sources.ServiceRequest


      if (Log.isDebugEnabled(Log.REQUEST))
        Log.debug(Log.REQUEST, "Session created for client : " + ip);
    }

    ServiceRequest srvReq = null;

    JeevesEngine jeeves = jeevesApplicationContext
        .getBean(JeevesEngine.class);
    try {
      srvReq = ServiceRequestFactory.create(request, response,
View Full Code Here


    }

    //------------------------------------------------------------------------
    //--- build service request

    ServiceRequest srvReq;

    //--- create request

        ConfigurableApplicationContext applicationContext = JeevesDelegatingFilterProxy.getApplicationContextFromServletContext
                (getServletContext());
        JeevesEngine jeeves = applicationContext.getBean(JeevesEngine.class);

    try {
      srvReq = ServiceRequestFactory.create(req, res, jeeves.getUploadDir(), jeeves.getMaxUploadSize());
    } catch (FileUploadTooBigEx e) {
            StringBuilder sb = new StringBuilder();
            sb.append("File upload too big - exceeds ").append(jeeves.getMaxUploadSize()).append(" Mb\n")
                .append("Error : ").append(e.getClass().getName()).append("\n");

            res.sendError(SC_BAD_REQUEST, sb.toString());

            // now stick the stack trace on the end and log the whole lot
      sb.append("Stack :\n").append(Util.getStackTrace(e));

      Log.error(Log.REQUEST,sb.toString());
      return;
    } catch (Exception e) {
      StringBuilder sb = new StringBuilder();

            sb.append("Cannot build ServiceRequest\n").append("Cause : ").append(e.getMessage()).append("\n")
                .append("Error : ").append(e.getClass().getName()).append("\n");

            res.sendError(SC_BAD_REQUEST, sb.toString());

            // now stick the stack trace on the end and log the whole lot
      sb.append("Stack :\n").append(Util.getStackTrace(e));
      Log.error(Log.REQUEST, sb.toString());
      return;
    }

        // Set the language of the request as the preferred language in a cookie
        final Cookie langCookie = new Cookie(Jeeves.LANG_COOKIE, srvReq.getLanguage());
        langCookie.setMaxAge((int) TimeUnit.DAYS.toSeconds(7));
        langCookie.setComment("Keeps the last language chosen to be the preferred language");
        langCookie.setVersion(1);
        langCookie.setPath("/");
        res.addCookie(langCookie);
View Full Code Here

TOP

Related Classes of jeeves.server.sources.ServiceRequest

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.