web.xml에 일반적으로 welcome-file에 index.jsp에 대해 아래와 같이 설정합니다.
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
하지만 index.jsp가 아닌 스트러츠 액션인 index.do를 사용하기 위해
<welcome-file-list>
<welcome-file>index.do</welcome-flie>
</welcome-file-list>
위와 같이 변경을 하면 동작하지 않습니다. (welcome-file-list 요소내에서는 서블릿 매핑을 사용하지 않기 때문)
그래서 이에 대한 대안으로 사용하는 방법이 여러가지 있겠지만 그 중 한가지가
web.xml은 그대로 index.jsp로 두고 index.jsp 파일 내에서 <jsp:forward page="index.do" /> 로 포워드를 하면 됩니다.
[iBatis] iBatis 다운로드 방법 (0) | 2012.09.14 |
---|---|
[jsp] JSTL 기초정리 (0) | 2012.09.11 |
전자정부 표준프레임워크 (개발자용 개발환경) 설치하기 (0) | 2012.09.09 |
자바의 장단점 (1) | 2011.01.25 |
자바의 소개(탄생과 변천과정) (1) | 2011.01.25 |