[Jesu] 제우스에서 웰컴 페이지(welcome page) 등록 방법
제우스에서는 두 가지 방법으로 웹 애플리케이션의 웰컴 페이지를 등록할 수 있습니다.
- 제우스의 디폴트 웰컴 페이지 등록(webcommon.xml)
- 웹 애플리케이션의 웰컴 페이지 등록(web.xml)
제우스의 디폴트 웰컴 페이지 등록(webcommon.xml)
등록 모든 애플리케이션에 적용됩니다. 등록된 순서대로 웰컴 페이지가 호출됩니다.
$ alias | grep jcfg
alias jcfg='cd ${JEUS_HOME}/domains/${DOMAIN_NAME}/config'
$ jcfg
$ cd servlet/
$ vi webcommon.xml
<!-- If you define welcome files in your own application's web.xml -->
<!-- deployment descriptor, that list *replaces* the list configured -->
<!-- here, so be sure to include any of the default values that you wish -->
<!-- to use within your application. -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
웹 애플리케이션의 웰컴 페이지 등록(web.xml)
각각의 웹 애플리케이션에 웰컴 페이지를 등록할 때 사용하며, webcommon.xml 파일에 설정된 웰컴 페이지보다 우선합니다.
web.xml은 Java 웹 애플리케이션의 설정 파일 중 하나로, Deployment Descriptor(배포 지시자) 파일이라고 불리며, 웹 애플리케이션의 구성 요소 및 동작 방식을 정의하는 데 사용됩니다. 주로 서블릿, 필터, 리스너 등의 웹 컴포넌트 설정 및 선언, URL 패턴과 서블릿 매핑, 에러 페이지 설정, 세션 관리 등의 내용을 담고 있습니다.
$ cd /path/to/application/WEB-INF
$ vi web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<session-config>
<!-- Default to 30 minute session timeouts -->
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/login.jsp</welcome-file>
<welcome-file>/index.jsp</welcome-file>
<welcome-file>/index.html</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>