ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • @ResponseBody없이 json 처리
    Spring 2016. 9. 2. 16:07

    <!-- jackson -->

    <dependency>

    <groupId>com.fasterxml.jackson.core</groupId>

    <artifactId>jackson-databind</artifactId>

    <version>2.5.1</version>

    </dependency>

    -------------------------------------------------------------------------------------------------

    <beans:bean id="beanNameResolver" 

     class="org.springframework.web.servlet.view.BeanNameViewResolver" p:order="0"/>

    <beans:bean id="jsonV" class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">

       <beans:property name="contentType" value="application/json;charset=UTF-8"/>

    </beans:bean>

    -------------------------------------------------------------------------------------------------

    @RequestMapping( value = "/jsonV.do" )

    public ModelAndView xxProc(ModelMap model ) throws Exception {

    model.put( "result", "Y" );

    model.put( "message", "OK" );

    return new ModelAndView( "jsonV", model );

    }


    'Spring' 카테고리의 다른 글

    redirect시 POST방식 Attribute 전달하기  (0) 2016.09.02
    GsonHttpMessageConverter  (0) 2016.09.02
    Spring 4 gradle  (0) 2015.12.16

    댓글

Designed by Tistory.