diff --git a/src/main/java/cokr/xit/fims/FimsApplication.java b/src/main/java/cokr/xit/fims/FimsApplication.java index c2ab4c01..b040ab98 100644 --- a/src/main/java/cokr/xit/fims/FimsApplication.java +++ b/src/main/java/cokr/xit/fims/FimsApplication.java @@ -9,7 +9,6 @@ import org.springframework.context.annotation.ImportResource; import cokr.xit.base.ServletCustomizer; import cokr.xit.base.boot.XitBaseApplication; import cokr.xit.fims.task.TaskMvcConfig; -import cokr.xit.foundation.boot.Yml; @ImportAutoConfiguration({ServletCustomizer.class, TaskMvcConfig.class}) @ImportResource("classpath:spring/context-*.xml") @@ -17,17 +16,6 @@ public class FimsApplication extends XitBaseApplication { public static void main(String[] args) { - try { - Yml yml = new Yml("application", "application.yml"); - String serverSggCd = yml.getValue("server.sggCd"); - String serverInstCd = yml.getValue("server.instCd"); - System.setProperty("instCd", serverInstCd); - System.setProperty("sggCd", serverSggCd); - } catch (Exception e) { - throw new RuntimeException("서버정보 로드 오류"); - } - - final SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(FimsApplication.class); final SpringApplication application = applicationBuilder.build(); application.setBannerMode(Banner.Mode.OFF); diff --git a/src/main/java/cokr/xit/fims/MainController.java b/src/main/java/cokr/xit/fims/MainController.java index 957af3c8..a5b1e5b3 100644 --- a/src/main/java/cokr/xit/fims/MainController.java +++ b/src/main/java/cokr/xit/fims/MainController.java @@ -5,6 +5,7 @@ import java.util.List; import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -20,6 +21,12 @@ import cokr.xit.foundation.web.RequestHandlerReader; @Controller public class MainController extends cokr.xit.base.web.MainController { + @Value("${server.sggCd}") + private String sggCd; + + @Value("${server.instCd}") + private String instCd; + @Autowired private TaskRequestMappingHandlerMapping requestHandlers; @@ -31,9 +38,14 @@ public class MainController extends cokr.xit.base.web.MainController { @Override public ModelAndView loginPage() { + + ModelAndView mav = new ModelAndView("login"); List sggList = fimsOgdpBean.selectAllSggList(); mav.addObject("sggList", sggList); + + mav.addObject("sysInstCd", instCd); + mav.addObject("sysSggCd", sggCd); return mav; } diff --git a/src/main/webapp/WEB-INF/jsp/login.jsp b/src/main/webapp/WEB-INF/jsp/login.jsp index cb91be13..2e53e1e9 100644 --- a/src/main/webapp/WEB-INF/jsp/login.jsp +++ b/src/main/webapp/WEB-INF/jsp/login.jsp @@ -1,6 +1,5 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> -<% String systemInst = System.getProperty("instCd") != null ? System.getProperty("instCd") : ""; %>