Package org.springframework.web.servlet.view.json

Examples of org.springframework.web.servlet.view.json.MappingJacksonJsonView


     */
    @PreAuthorize("hasRole('ENCUESTAME_USER')")
    @RequestMapping(value = "/file/upload/profile", method = RequestMethod.POST)
    public ModelAndView handleUserProfileFileUpload(
            @RequestParam("file") MultipartFile multipartFile) {
        ModelAndView mav = new ModelAndView(new MappingJacksonJsonView());
        if (!multipartFile.isEmpty()) {
            log.debug(multipartFile.getName());
            String orgName = multipartFile.getOriginalFilename();
            log.debug("org name "+orgName);
            //TODO: convert name to numbers, MD5 hash.
View Full Code Here


    public ContentNegotiatingViewResolver contentViewResolver() throws Exception {
        ContentNegotiatingViewResolver contentViewResolver = new ContentNegotiatingViewResolver();
        ContentNegotiationManagerFactoryBean contentNegotiationManager = new ContentNegotiationManagerFactoryBean();
        contentNegotiationManager.addMediaType("json", MediaType.APPLICATION_JSON);
        contentViewResolver.setContentNegotiationManager(contentNegotiationManager.getObject());
        contentViewResolver.setDefaultViews(Arrays.<View>asList(new MappingJacksonJsonView()));
        return contentViewResolver;
    }
View Full Code Here

        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setPrefix("/WEB-INF/jsp/");
        viewResolver.setSuffix(".jsp");

        MappingJacksonJsonView defaultView = new MappingJacksonJsonView();
        defaultView.setExtractValueFromSingleKeyModel(true);

        ContentNegotiatingViewResolver contentViewResolver = new ContentNegotiatingViewResolver();
        contentViewResolver.setContentNegotiationManager(contentNegotiationManager.getObject());
        contentViewResolver.setDefaultViews(Arrays.<View>asList(new MappingJacksonJsonView()));
        contentViewResolver.setViewResolvers(Arrays.<ViewResolver>asList(viewResolver));
        contentViewResolver.setDefaultViews(Arrays.<View>asList(defaultView));
        return contentViewResolver;
    }
View Full Code Here

   
    if (mimeTypeToViewResolver.containsKey(MediaType.APPLICATION_JSON_VALUE) == false) {
      ViewResolver viewResolver = new ViewResolver() {
        @Override
        public View resolveViewName(String viewName, Locale locale) throws Exception {
          MappingJacksonJsonView jsonView = new MappingJacksonJsonView();
          jsonView.setApplicationContext(getApplicationContext());
          return jsonView;
        }
      };
     
      mimeTypeToViewResolver.put(MediaType.APPLICATION_JSON_VALUE, viewResolver);
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.view.json.MappingJacksonJsonView

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.