spring MVC 는 주 해 를 이용 하여 JSon 으로 바로 돌아 갑 니 다.

935 단어 JAVASpring
package com.jt.report.scheduler;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.jt.report.entity.Event;
import com.jt.report.service.SlaveDbService;

@Component
@RequestMapping("/test")
public class ReportJobForTest {
	
	@Autowired
	SlaveDbService slaveDbService;
	
	
	@RequestMapping(value = "/slaveEvent", method = RequestMethod.GET)
	@ResponseBody
	@JsonGetter
	public List test(){
		
		List list=slaveDbService.getSlaveEvent(null);
		
		return list;
		
	}	
	
}

좋은 웹페이지 즐겨찾기