Examples of WebContext


Examples of org.jmanage.webui.util.WebContext

    // TODO: It will be good to remove MessageFormat usage here and pass the required information
    //   to the dashboard - rk
    public int doStartTag() throws JspException{
        HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
        WebContext context = null;
        try{
            context = WebContext.get(request);
            ApplicationConfig appConfig = context.getApplicationConfig();
           
            // Graphs at cluster level are not supported yet
            assert !appConfig.isCluster();
            String dashboardId = request.getParameter("dashBID");
            DashboardConfig currentDashboardConfig = DashboardRepository.getInstance().get(dashboardId);
           
            assert currentDashboardConfig != null : "Error retrieving dashboard details";
            DashboardComponent component =
                    currentDashboardConfig.getComponents().get(getId());

            String componentDisplay = component.draw(new DashboardContextImpl(context, currentDashboardConfig,
                    (HttpServletRequest)pageContext.getRequest()));
            componentDisplay = MessageFormat.format(componentDisplay, getWidth(),
                    getHeight(), Utils.getCookieValue(request, "JSESSIONID"));
            pageContext.getOut().println(componentDisplay);
        }catch(Throwable e){
            logger.log(Level.SEVERE, "Error displaying component", e);
        }finally{
            if(context != null)
                context.releaseResources();
        }
       
        return SKIP_BODY;
    }
View Full Code Here

Examples of org.jmanage.webui.util.WebContext

    }

    public int doStartTag() throws JspException{

        HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
        WebContext context = WebContext.get(request);
        ApplicationConfig appConfig = context.getApplicationConfig();
        // graphs at cluster level are not yet supported
        assert !appConfig.isCluster();
        GraphConfig graphConfig = appConfig.findGraph(id);

        HtmlElement applet = new HtmlElement("applet");
View Full Code Here

Examples of org.jmanage.webui.util.WebContext

    public final ActionForward execute(ActionMapping mapping,
                                       ActionForm actionForm,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
            throws Exception {
        WebContext context = WebContext.get(request);
        return execute(context, mapping, actionForm, request, response);
    }
View Full Code Here

Examples of org.jmanage.webui.util.WebContext

* @author rkalra
*/
public class UserViewHelper {
   
    public static boolean hasAdminAccess(HttpServletRequest request){
        WebContext webContext = null;
        try{
            webContext = WebContext.get(request);
            return AccessController.hasAdminAccess(webContext.getServiceContext());
        }finally{
            if(webContext != null)
                webContext.releaseResources();
        }
    }
View Full Code Here

Examples of org.jmanage.webui.util.WebContext

        this.acl = acl;
    }

    public int doStartTag() throws JspException{
        if(acl!=null){
            WebContext context = WebContext.get(
                    (HttpServletRequest)pageContext.getRequest());
            if(!AccessController.canAccess(Utils.getServiceContext(context),acl)){
                hasAccess = false;
                return SKIP_BODY;
            }
View Full Code Here

Examples of org.pac4j.core.context.WebContext

   
    @SuppressWarnings("unchecked")
    @Override
    protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response) {
       
        final WebContext context = new J2EContext(request, response);
       
        final Client<CasCredentials, CasProfile> client = this.clients.findClient(context);
       
        CasCredentials credentials = null;
        try {
View Full Code Here

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

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

        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

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

        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

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

                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
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.