Programming/JavaScript

sub root 주소 숨기는 방법.

Edward. K 2008. 8. 8. 09:48
반응형
Tomcat 에 다음과 같이 sub root를 추가 했다고 치자.

<Context path="/test" docBase="C:\Project\test\" privileged="true" antiResourceLocking="false" antiJARLocking="false"/>
   >> C:\Tomcat5\conf\server.xml

그렇다면. web 에서의 접근은   http://127.0.0.1:8080/test  게 된다.

이   /test  라는 prefix 경로를 없애고자 한다면. 다음과 같이 하자
그러면 주소창에는 http://127.0.0.1:8080  이렇게만 보이게 된다.
단, 프레임대로 하자.


C:/Project/test/index.html
 <html>
<head>
<script>
    top.location.href = "/";    /* 상위 폴더를 호출*/
</script>
</head>
</html>

C:/Tomcat5/webapps/ROOT/index.html
<html>
<head>
<meta http-equiv="REFRESH" content="100;URL=http://127.0.0.1/">
<META NAME="src" CONTENT="index.html">
<title>The Only Process</title>
</head>
<frameset rows="*,0" border=0>
    <frame name="main_top" src="/test/intro.html">  <!-- 초기 호출될 파일-->
    <frame name="work_top" src="">
</frameset>
</html>

반응형