You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
4.0 KiB
Java
132 lines
4.0 KiB
Java
package com.inswave.template.controller;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.List;
|
|
import java.util.Iterator;
|
|
import java.util.Properties;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
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 com.inswave.template.service.MemberService;
|
|
import com.inswave.util.PageURIUtil;
|
|
import com.inswave.util.UserInfo;
|
|
|
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|
|
|
@SuppressFBWarnings
|
|
@Controller
|
|
public class InitController {
|
|
|
|
@Autowired
|
|
private MemberService service;
|
|
|
|
@Autowired
|
|
private UserInfo userInfo;
|
|
|
|
public InitController() {
|
|
}
|
|
|
|
/**
|
|
* 다국어 처리 Root Url 처리
|
|
*
|
|
* @date 2017.12.22
|
|
* @author Inswave
|
|
* @example websquare 진입 후 세션과 설정 값에 따른 화면 xml 분기를 위한 controller. 고려 대상은 websquare.jsp와 I18N.jsp. 화면 페이지의 정보는 properties파일에서 일괄 관리.
|
|
* @todo 차후 interceptor에서 일괄 처리 가능한지 체크 해야 함.
|
|
*/
|
|
@RequestMapping("/I18N")
|
|
public String indexMultiLang(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
|
|
model.addAttribute("movePage", getLoginPage(request.getParameter("w2xPath")));
|
|
return "websquare/I18N";
|
|
}
|
|
|
|
/**
|
|
*
|
|
* 기본 Root Url 처리
|
|
*
|
|
* @date 2017.12.22
|
|
* @author Inswave
|
|
* @todo url의 경로가 /(root)인 경우 웹스퀘어 엔진에서 하위 컨텐츠 로딩 부분의 특이사항이 발견되어 redirect로 처리.수정 및 개선 필요.
|
|
*/
|
|
@RequestMapping(value = "/", method = RequestMethod.GET)
|
|
public String IndexBase(HttpServletRequest request, Model model) throws Exception {
|
|
model.addAttribute("movePage", getLoginPage(request.getParameter("w2xPath")));
|
|
return "websquare/websquare";
|
|
}
|
|
|
|
/**
|
|
*
|
|
* WebSquare Url 처리한다.
|
|
*
|
|
* @date 2017.12.22
|
|
* @author Inswave
|
|
* @todo url의 경로가 /(root)인 경우 웹스퀘어 엔진에서 하위 컨텐츠 로딩 부분의 특이사항이 발견되어 redirect로 처리.수정 및 개선 필요.
|
|
*/
|
|
@RequestMapping(value = "/ws", method = RequestMethod.GET)
|
|
public String IndexWebSquare(HttpServletRequest request, Model model) throws Exception {
|
|
return "websquare/websquare";
|
|
}
|
|
|
|
/**
|
|
* SPA IFrame에서 호출하는 Blank 페이지를 반환하다.
|
|
* @param request
|
|
* @param model
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
@RequestMapping(value = "/blank.xml", method = RequestMethod.GET)
|
|
public String callBlankPage(HttpServletRequest request, Model model) throws Exception {
|
|
return "websquare/blank";
|
|
}
|
|
|
|
/**
|
|
* 로그인 페이지 Url을 반환한다.
|
|
*
|
|
* @param w2xPath w2xPath 파라미터
|
|
* @return 로그인 페이지 Url
|
|
*/
|
|
private String getLoginPage(String w2xPath) {
|
|
String movePage = w2xPath;
|
|
|
|
// session이 없을 경우 login 화면으로 이동.
|
|
if (!userInfo.isLogined()) {
|
|
// session이 있고 w2xPath가 없을 경우 index화면으로 이동.
|
|
movePage = PageURIUtil.getLoginPage();
|
|
} else {
|
|
if (movePage == null) {
|
|
// DB 설정조회 초기 page 구성
|
|
movePage = PageURIUtil.getIndexPageURI(userInfo.getMainLayoutCode());
|
|
|
|
// DB에 값이 저장되어 있지 않은 경우 기본 index화면으로 이동
|
|
if (movePage == null) {
|
|
movePage = PageURIUtil.getIndexPageURI();
|
|
}
|
|
}
|
|
}
|
|
return movePage;
|
|
}
|
|
|
|
/**
|
|
* refresh
|
|
* @param request
|
|
* @param model
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
@RequestMapping(value = "/refresh", method = RequestMethod.GET)
|
|
public String callRefreshPage(HttpServletRequest request, Model model) {
|
|
return "websquare/refresh";
|
|
}
|
|
}
|