Package org.springframework.web.servlet

Examples of org.springframework.web.servlet.ModelAndView


                    }
                    tmpWar.delete();
                }
            }
        }
        return new ModelAndView(new InternalResourceView(getViewName()));
    }
View Full Code Here


            } else {
                dsGroup.addDataSourceInfo(ds);
            }
        }

        return new ModelAndView(getViewName(), "dataSourceGroups", dataSourceGroups);
    }
View Full Code Here

            WrapperManager.restartAndReturn();
            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

            getContainerWrapper().getTomcatContainer().remove(contextName);

        } catch (Exception e) {
            request.setAttribute("errorMessage", e.getMessage());
            logger.error(e);
            return new ModelAndView(new InternalResourceView(getFailureViewName() == null ? getViewName() : getFailureViewName()));
        }
        return new ModelAndView(new RedirectView(request.getContextPath() + getViewName()));
    }
View Full Code Here

            } catch (Exception e) {
                request.setAttribute("errorMessage", e.getMessage());
            }
        }

        return new ModelAndView(new InternalResourceView(getViewName()));
    }
View Full Code Here

            WrapperManager.requestThreadDump();
            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

public class FollowController extends LogHandlerController  {

    protected ModelAndView handleLogFile(HttpServletRequest request, HttpServletResponse response, LogDestination logDest) throws Exception {

        ModelAndView mv = new ModelAndView(getViewName());
        File file = logDest.getFile();

        if (file.exists()) {
            LinkedList lines = new LinkedList();
            long actualLength = file.length();
            long lastKnownLength = ServletRequestUtils.getLongParameter(request, "lastKnownLength", 0);
            long currentLength = ServletRequestUtils.getLongParameter(request, "currentLength", actualLength);
            long maxReadLines = ServletRequestUtils.getLongParameter(request, "maxReadLines", 0);

            if (lastKnownLength > currentLength
                    || lastKnownLength > actualLength
                    || currentLength > actualLength) {
                //
                // file length got reset
                //
                lastKnownLength = 0;
                lines.add(" ------------- THE FILE HAS BEEN TRUNCATED --------------");
            }

            BackwardsFileStream bfs = new BackwardsFileStream(file, currentLength);
            try {
                BackwardsLineReader br = new BackwardsLineReader(bfs);
                long readSize = 0;
                long totalReadSize = currentLength - lastKnownLength;
                String s;
                while (readSize < totalReadSize && (s = br.readLine()) != null) {
                    if (!s.equals("")){
                        lines.addFirst(s);
                        readSize += s.length();
                    } else {
                        readSize++;
                    }
                    if (maxReadLines != 0 && lines.size() >= maxReadLines) {
                        break;
                    }
                }

                if (lastKnownLength != 0 && readSize > totalReadSize) {
                    lines.removeFirst();
                }
            } finally {
                bfs.close();
            }
           
            mv.addObject("lines", lines);
        }
        return mv;
    }
View Full Code Here

public class SetupFollowController extends LogHandlerController {

    protected ModelAndView handleLogFile(HttpServletRequest request, HttpServletResponse response, LogDestination logDest) throws Exception {
        File logFile = logDest.getFile();
        List sources = getLogResolver().getLogSources(logFile);
        return new ModelAndView(getViewName())
                .addObject("log", logDest)
                .addObject("sources", sources);
    }
View Full Code Here

    }

    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        TomcatContainer container = getContainerWrapper().getTomcatContainer();
        Cluster cluster = getClusterWrapper().getCluster(container.getName(), container.getHostName(), isLoadMembers());
        return new ModelAndView(getViewName())
                .addObject("cluster", cluster)
                .addObject("collectionPeriod", new Long(getCollectionPeriod()));
    }
View Full Code Here

            wi.setLaunchedAsService(WrapperManager.isLaunchedAsService());
        } catch (ClassNotFoundException e) {
            logger.info("Could not find WrapperManager class. Is wrapper.jar in the classpath?");
            wi.setControlledByWrapper(false);
        }
        return new ModelAndView(getViewName(), "wrapperInfo", wi);
    }
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.