Package org.sf.bee.app.server.web.context

Examples of org.sf.bee.app.server.web.context.WebContext


                new String[]{METHOD_GET, METHOD_POST});

        final RESTfulCommand command = new RESTfulCommand(
                request.getRequestLine().getUri());
        if (command.isValid()) {
            final WebContext webcontext = new WebContext(request, response,
                    context);
            // decode parameters
            HTMLUtils.URLDecodeAll(command.getParameters());
            try {
                if (request instanceof HttpEntityEnclosingRequest) {
View Full Code Here


        final String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
        if (!method.equals("GET")) {
            throw new MethodNotSupportedException(method + " method not supported");
        }

        final WebContext webcontext = new WebContext(request, response, context);
        final String target = request.getRequestLine().getUri();
        final WebUri uri = new WebUri(target);
        final String path = uri.getFilePath(); // "rest/service/method"
        final Map<String, String> query = uri.getQueryParamsAsStringMap();
        //-- parse path --//
View Full Code Here

        super.onLog(Level.FINE, "Handlig Class: " + this.getClass().getName());

        super.validate(request,
                new String[]{METHOD_GET, METHOD_POST, METHOD_HEAD});
       
        final WebContext webcontex = new WebContext(request, response, context);
        // execute in thread
        final NHttpFileHandlerThread th = new NHttpFileHandlerThread(
                this,
                _docRoot,
                webcontex, trigger);
View Full Code Here

                System.out.println("Incoming entity content (bytes): " + entityContent.length);
            } catch (Throwable t) {
            }
        }
       
        final WebContext webcontext = new WebContext(request, response, context);
        final File file = WebServerFacade.getInstance().lookupFile(
                    this.getDocRoot(), webcontext.getRequest().getFilePath());
        //final File file = new File(this.getDocRoot(), webrequest.getFileName());
        if (!file.exists()) {
            WebServerFacade.getInstance().writeFileNotFound(webcontext, file);
        } else if (!file.canRead() || file.isDirectory()) {
            WebServerFacade.getInstance().writeForbidden(webcontext);
View Full Code Here

    // ------------------------------------------------------------------------
    //                      p r i v a t e
    // ------------------------------------------------------------------------
    private void onBeforeCreateContent(final OnBeforeCreateContent event) {
        final WebContext webcontext = event.getWebContext();
        if (null != webcontext) {
            // add request tool
            final Req req = new Req(webcontext.getRequest());
            event.getTemplateContextData().put(req.getName(), req);

            // add cookies tool
            final Cookies cookies = new Cookies(webcontext);
            event.getTemplateContextData().put(cookies.getName(), cookies);
View Full Code Here

TOP

Related Classes of org.sf.bee.app.server.web.context.WebContext

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.