Package org.jmanage.webui.util

Examples of org.jmanage.webui.util.WebContext


            throws IOException, ServletException{

        final String requestPath = mapping.getPath();
        logger.fine("Start Request Path:" + requestPath);

        WebContext context = null;
        ActionForward resultForward = null;
        try{
            context = WebContext.get(request);
            /* ensure user is logged-in (except for login page)*/
            resultForward = ensureLoggedIn(context, request, response, mapping);
            if(resultForward == null){
                /*  execute the action  */
                resultForward = action.execute(mapping, form, request, response);
            }
        }catch (Exception e){
            logger.log(Level.FINE, "Exception on Request: " + requestPath, e);
            /* process exception */
            resultForward =
                    processException(request, response, e, form, mapping);
        }finally{
            /* release resources */
            if(context != null)
                context.releaseResources();
            /* logging */
            String resultForwardPath = (resultForward == null) ?
                    "none" : resultForward.getPath();
            if(resultForwardPath == null){
                /* the path attribute of resultForward was null */
 
View Full Code Here


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

    }

    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

    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

* @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

        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

TOP

Related Classes of org.jmanage.webui.util.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.