package egovframework.com.utl.jso.web; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import egovframework.com.cmm.EgovMessageSource; import egovframework.com.cmm.service.EgovCmmUseService; import egovframework.rte.fdl.property.EgovPropertyService; @Controller public class EgovUtlJsonController { @Resource(name="egovMessageSource") EgovMessageSource egovMessageSource; @Resource(name = "EgovCmmUseService") EgovCmmUseService egovCmmUseService; /** EgovPropertyService */ @Resource(name = "propertiesService") protected EgovPropertyService propertiesService; private static final Logger LOGGER = LoggerFactory.getLogger(EgovUtlJsonController.class); @RequestMapping(value="/utl/jso/EgovUtlJsonInquire.do",method = RequestMethod.GET) public String selectUtlJsonInquire() throws Exception { return "egovframework/com/utl/jso/EgovUtlJsonInquire"; } @RequestMapping(value="/utl/jso/EgovUtlJsonInquire.do",method = RequestMethod.POST) public ModelAndView selectUtlJsonInquirePost(@RequestParam Map commandMap) throws Exception { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("jsonView"); LOGGER.debug("EgovUtlJsonController EgovUtlJsonInquire START========="); LOGGER.debug("commandMap>"+commandMap); modelAndView.addObject("fruits1", "apple"); modelAndView.addObject("fruits2", "orange"); modelAndView.addObject("fruits3", "lemon"); modelAndView.addObject("fruits4", "lime"); modelAndView.addObject("fruits5", "mango"); LOGGER.debug("EgovUtlJsonController EgovUtlJsonInquire END========="); return modelAndView; } @RequestMapping(value="/utl/jso/EgovUtlJsonMultiInquire.do",method = RequestMethod.GET) public String selectUtlJsonMultiInquire(@RequestParam Map commandMap) throws Exception { return "egovframework/com/utl/jso/EgovUtlJsonMultiInquire"; } @RequestMapping(value="/utl/jso/EgovUtlJsonMultiInquire.do",method = RequestMethod.POST) public ModelAndView selectUtlJsonMultiInquirePost(@RequestParam Map commandMap) throws Exception { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("jsonView"); LOGGER.debug("EgovUtlJsonController selectUtlJsonMultiInquire START========="); LOGGER.debug("commandMap>"+commandMap); modelAndView.addObject("fruits1", "apple"); modelAndView.addObject("fruits2", "orange"); modelAndView.addObject("fruits3", "lemon"); modelAndView.addObject("fruits4", "lime"); modelAndView.addObject("fruits5", "mango"); HashMap mp = new HashMap(); mp.put("fruits1", "apple"); mp.put("fruits2", "orange"); mp.put("fruits3", "lemon"); mp.put("fruits4", "lime"); mp.put("fruits5", "mango"); List list = new ArrayList(); list.add(mp); list.add(mp); list.add(mp); list.add(mp); list.add(mp); modelAndView.addObject("list", list); LOGGER.debug("EgovUtlJsonController selectUtlJsonMultiInquire END========="); return modelAndView; } }