톰캣을 설치하고 index.jsp 를 불러 들이면 보통 디폴트 페이지인 고양이 그림의 인덱스 화면이 나타난다. 이 파일은 webapps/root/index.jsp 파일인데 이파일을 변경 하는데 꽤 힘들었다

디폴트 페이지라 무슨 서블릿에 저장 되어있어 나타난다는데 그런건 모르겠다...

일단 방법은 /webapps/root/web-inf/web.xml 파일을 연다.

-- WEB.XML --
<servlet>  
   <servlet-name>org.apache.jsp.index_jsp</servlet-name>  
    <servlet-class>org.apache.jsp.index_jsp</servlet-class>  
</servlet>  
<servlet-mapping>  
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>  
    <url-pattern>/index.jsp</url-pattern>  
</servlet-mapping>  


위와 같은 코드가 있을수도 있고 없을수도 있다. 있다면 삭제를 해준다.

다음은 /work/catalina/localhost/_/org/apache/jsp 로 이동을한다.

index에 관련된 클래스와 자바 파일이 있을것이다.
index_jsp.class    index_jsp.java 
위와 같은 파일을 삭제 해준다.

다시 톰캣을 restart 를 해준후 자신이 만든 index.jsp 를 읽어 들이면
바뀐 화면을 볼수 있다.

+ Recent posts