Package org.springframework.web.servlet

Examples of org.springframework.web.servlet.ModelAndView


                if (e instanceof ThreadDeath) {
                    throw (ThreadDeath) e;
                }
            }
        }
        return new ModelAndView(getViewName(), "available",
                Boolean.valueOf(context != null && context.getAvailable()));
    }
View Full Code Here


        if (referer != null) {
            redirectURL = referer.replaceAll(replacePattern, "");
        } else {
            redirectURL = request.getContextPath() + getViewName();
        }
        return new ModelAndView(new RedirectView(redirectURL));
    }
View Full Code Here

                    rowsAffected = results.size();
                }
            }
        }

        ModelAndView mv = new ModelAndView(getViewName(), "results", results);
        mv.addObject("rowsAffected", String.valueOf(rowsAffected));
        mv.addObject("rowsPerPage", String.valueOf(rowsPerPage));

        return mv;
    }
View Full Code Here

            throw new RuntimeException("Display target is not set for " + getClass().getName());
        }

        String xmlPath;
        File xmlFile = null;
        ModelAndView mv = new ModelAndView(getViewName());

        if (TARGET_WEB_XML.equals(displayTarget)) {
            ServletContext sctx = context.getServletContext();
            xmlPath = sctx.getRealPath("/WEB-INF/web.xml");
            xmlFile = new File(xmlPath);
            mv.addObject("fileDesc", getMessageSourceAccessor().getMessage("probe.src.app.viewxmlconf.webxml.desc"));
        } else if (TARGET_CONTEXT_XML.equals(displayTarget)) {
            xmlFile = getContainerWrapper().getTomcatContainer().getConfigFile(context);
            if (xmlFile != null) {
                xmlPath = xmlFile.getPath();
            } else {
                xmlPath = null;
            }
            mv.addObject("fileDesc", getMessageSourceAccessor().getMessage("probe.src.app.viewxmlconf.contextxml.desc"));
        } else {
            throw new RuntimeException("Unknown display target " + getDisplayTarget());
        }

        mv.addObject("displayTarget", displayTarget);
        mv.addObject("downloadUrl", downloadUrl);

        if (xmlFile != null) {
            mv.addObject("fileName", xmlFile.getName());
            if (xmlFile.exists()) {
                FileInputStream fis = new FileInputStream(xmlFile);
                try {
                    String encoding = System.getProperty("file.encoding");
                    mv.addObject("content", Utils.highlightStream("web.xml", fis, "xml", encoding == null ? "ISO-8859-1" : encoding));
                } finally {
                    fis.close();
                }
            } else {
                logger.debug("File " + xmlPath + " of " + contextName + " application does not exists.");
View Full Code Here

        this.containerListenerBean = containerListenerBean;
    }

    public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        List pools = containerListenerBean.getThreadPools();
        return new ModelAndView(getViewName())
                .addObject("pools", pools);
    }
View Full Code Here

            }
        }
        if (! applications.isEmpty() && ! showResources) {
            request.setAttribute("no_resources", Boolean.TRUE);
        }
        return new ModelAndView(getViewName(), "apps", applications);
    }
View Full Code Here

    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {

        boolean showAll = ServletRequestUtils.getBooleanParameter(request, "apps", false);
        List uniqueList = logResolver.getLogDestinations(showAll);
        if (uniqueList != null) {
            return new ModelAndView(getViewName())
                    .addObject("logs", uniqueList);
        } else {
            return new ModelAndView(errorView);
        }
    }
View Full Code Here

                request.setAttribute("errorMessage", getMessageSourceAccessor().getMessage("probe.src.reset.datasource.c3p0"));
            }

        }
        logger.debug("Redirected to " + redirectURL);
        return new ModelAndView(new RedirectView(redirectURL));
    }
View Full Code Here

            }
        }

        systemInformation.setSystemProperties(sysProps);

        return new ModelAndView(getViewName())
                .addObject("systemInformation", systemInformation)
                .addObject("runtime", getRuntimeInfoAccessor().getRuntimeInformation())
                .addObject("collectionPeriod", new Long(getCollectionPeriod()));
    }
View Full Code Here

            WrapperManager.stop(stopExitCode);
            done = true;
        } catch (ClassNotFoundException e) {
            logger.info("WrapperManager not found. Do you have wrapper.jar in the classpath?");
        }
        return new ModelAndView(getViewName(), "done", Boolean.valueOf(done));
    }
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.ModelAndView

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.