Index: core-module/src/main/java/egovframework/com/cmm/web/EgovComIndexController.java =================================================================== diff -u -r3378aeef18251570015a9efbed6402f39cffd95d -rfe3f6d3d1cdd6b19569c45cd650f384079e79609 --- core-module/src/main/java/egovframework/com/cmm/web/EgovComIndexController.java (.../EgovComIndexController.java) (revision 3378aeef18251570015a9efbed6402f39cffd95d) +++ core-module/src/main/java/egovframework/com/cmm/web/EgovComIndexController.java (.../EgovComIndexController.java) (revision fe3f6d3d1cdd6b19569c45cd650f384079e79609) @@ -1,14 +1,6 @@ package egovframework.com.cmm.web; -import java.lang.reflect.Method; -import java.util.Map; -import java.util.TreeMap; - import egovframework.com.cmm.IncludedCompInfoVO; -import egovframework.com.cmm.LoginVO; -import egovframework.com.cmm.annotation.IncludedInfo; -import egovframework.com.cmm.util.EgovUserDetailsHelper; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -19,6 +11,8 @@ import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; +import java.util.Map; + @Controller public class EgovComIndexController implements ApplicationContextAware, InitializingBean { @@ -38,105 +32,7 @@ @RequestMapping("/index.do") public String index(ModelMap model) { - return "egovframework/com/cmm/EgovUnitMain"; + return "/"; } - @RequestMapping("/EgovTop.do") - public String top() { - return "egovframework/com/cmm/EgovUnitTop"; - } - - @RequestMapping("/EgovBottom.do") - public String bottom() { - return "egovframework/com/cmm/EgovUnitBottom"; - } - - @RequestMapping("/EgovContent.do") - public String setContent(ModelMap model) { - - LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); - model.addAttribute("loginVO", loginVO); - - return "egovframework/com/cmm/EgovUnitContent"; - } - - @RequestMapping("/EgovLeft.do") - public String setLeftMenu(ModelMap model) { - - /* 최초 한 번만 실행하여 map에 저장해 놓는다. */ - if (map == null) { - map = new TreeMap(); - RequestMapping rmAnnotation; - IncludedInfo annotation; - IncludedCompInfoVO zooVO; - - /* - * EgovLoginController가 AOP Proxy되는 바람에 클래스를 reflection으로 가져올 수 없음 - */ - try { - Class loginController = Class.forName("egovframework.com.uat.uia.web.EgovLoginController"); - Method[] methods = loginController.getMethods(); - for (int i = 0; i < methods.length; i++) { - annotation = methods[i].getAnnotation(IncludedInfo.class); - - if (annotation != null) { - LOGGER.debug("Found @IncludedInfo Method : {}", methods[i]); - zooVO = new IncludedCompInfoVO(); - zooVO.setName(annotation.name()); - zooVO.setOrder(annotation.order()); - zooVO.setGid(annotation.gid()); - - rmAnnotation = methods[i].getAnnotation(RequestMapping.class); - if ("".equals(annotation.listUrl()) && rmAnnotation != null) { - zooVO.setListUrl(rmAnnotation.value()[0]); - } else { - zooVO.setListUrl(annotation.listUrl()); - } - map.put(zooVO.getOrder(), zooVO); - } - } - } catch (ClassNotFoundException e) { - LOGGER.error("No egovframework.com.uat.uia.web.EgovLoginController!!"); - } - /* 여기까지 AOP Proxy로 인한 코드 */ - - /*@Controller Annotation 처리된 클래스를 모두 찾는다.*/ - Map myZoos = applicationContext.getBeansWithAnnotation(Controller.class); - LOGGER.debug("How many Controllers : ", myZoos.size()); - for (final Object myZoo : myZoos.values()) { - Class zooClass = myZoo.getClass(); - - Method[] methods = zooClass.getMethods(); - LOGGER.debug("Controller Detected {}", zooClass); - for (int i = 0; i < methods.length; i++) { - annotation = methods[i].getAnnotation(IncludedInfo.class); - - if (annotation != null) { - //LOG.debug("Found @IncludedInfo Method : " + methods[i] ); - zooVO = new IncludedCompInfoVO(); - zooVO.setName(annotation.name()); - zooVO.setOrder(annotation.order()); - zooVO.setGid(annotation.gid()); - /* - * 목록형 조회를 위한 url 매핑은 @IncludedInfo나 @RequestMapping에서 가져온다 - */ - rmAnnotation = methods[i].getAnnotation(RequestMapping.class); - if ("".equals(annotation.listUrl())) { - zooVO.setListUrl(rmAnnotation.value()[0]); - } else { - zooVO.setListUrl(annotation.listUrl()); - } - - map.put(zooVO.getOrder(), zooVO); - } - } - } - } - - model.addAttribute("resultList", map.values()); - - LOGGER.debug("EgovComIndexController index is called "); - - return "egovframework/com/cmm/EgovUnitLeft"; - } }