Package org.springframework.web.servlet

Examples of org.springframework.web.servlet.ModelAndView.addObject()


        } 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);
View Full Code Here


        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));
View Full Code Here

            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

                }
            } finally {
                bfs.close();
            }
           
            mv.addObject("lines", lines);
        }
        return mv;
    }

}
View Full Code Here

                @RequestParam(value = "styleName", required = false) String styleName,
                @RequestParam(value = "featureStyleId", required = false) String featureStyleId,
                HttpServletRequest request) throws AdvancedviewsException {
    ModelAndView mav = new ModelAndView();
    mav.setViewName(LEGENDICONS_VIEW_NAME);
    mav.addObject(IMAGE_KEY, iconService.createLegendIcon(widgetId, layerId, styleName, featureStyleId));
    return mav;
  }

  @ExceptionHandler
  public ModelAndView exception(AdvancedviewsException exception, HttpServletResponse response) throws Exception {
View Full Code Here

      @RequestParam(value = "download", defaultValue = DOWNLOAD_METHOD_SAVE) String download,
      @RequestParam(value = "name", defaultValue = "geomajas.pdf") String fileName)
      throws PrintingException {
    ModelAndView mav = new ModelAndView();
    mav.setViewName(DOCUMENT_VIEW_NAME);
    mav.addObject(DOCUMENT_KEY, printService.removeDocument(documentId));
    mav.addObject(DOWNLOAD_KEY, download);
    mav.addObject(FILENAME_KEY, fileName);
    mav.addObject(FORMAT_KEY, Format.decode(fileName));
    return mav;
  }
View Full Code Here

      @RequestParam(value = "name", defaultValue = "geomajas.pdf") String fileName)
      throws PrintingException {
    ModelAndView mav = new ModelAndView();
    mav.setViewName(DOCUMENT_VIEW_NAME);
    mav.addObject(DOCUMENT_KEY, printService.removeDocument(documentId));
    mav.addObject(DOWNLOAD_KEY, download);
    mav.addObject(FILENAME_KEY, fileName);
    mav.addObject(FORMAT_KEY, Format.decode(fileName));
    return mav;
  }
 
View Full Code Here

      throws PrintingException {
    ModelAndView mav = new ModelAndView();
    mav.setViewName(DOCUMENT_VIEW_NAME);
    mav.addObject(DOCUMENT_KEY, printService.removeDocument(documentId));
    mav.addObject(DOWNLOAD_KEY, download);
    mav.addObject(FILENAME_KEY, fileName);
    mav.addObject(FORMAT_KEY, Format.decode(fileName));
    return mav;
  }
 
  @ExceptionHandler
View Full Code Here

    ModelAndView mav = new ModelAndView();
    mav.setViewName(DOCUMENT_VIEW_NAME);
    mav.addObject(DOCUMENT_KEY, printService.removeDocument(documentId));
    mav.addObject(DOWNLOAD_KEY, download);
    mav.addObject(FILENAME_KEY, fileName);
    mav.addObject(FORMAT_KEY, Format.decode(fileName));
    return mav;
  }
 
  @ExceptionHandler
  public ModelAndView exception(PrintingException exception, HttpServletResponse response) throws Exception {
View Full Code Here

      ex.printStackTrace(pw);
      result.setStackTrace(sw.toString());
    }

    ModelAndView mv = new ModelAndView(view);
    mv.addObject(result);
   
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
   
    return mv;
  }
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.