Hi Sivaraman,
Since every web application invoked in Tomcat must based on its
WEB-INF/web.xml, so if you go to your local Tomcat's
web-apps/ROOT/WEB-INF, look for web.xml, you will see the following, (or similar stuff,
varies from TomCat's version):
<!-- JSPC servlet mappings start -->
<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>
<!-- JSPC servlet mappings end -->
Those are where when you type
http://localhost:8080/ goes, The Tomcat
get this request, based on the web.xml, directly make your request go to
index.jsp, if you wanna move to your own page (instead of overwritting
index.jsp), you just need to do
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<!-- <servlet-class>org.apache.jsp.index_jsp</servlet-class> -->
<jsp-file>/YourOwnJsp.jsp</jsp-file>
</servlet>
Then, restart server, it should go to your page when you type
http://localhost:8080/ All this relates to the Servlet mapping, there's a very good book to recommend, SCWCD exam study kit, if you go to SCWCD forum, you'll see this book is rated as "golden" book. Once you read the first 5 chapters, you'll havea great understanding for how servlet/jsp works.
I used to have the similar question as yours, after I read that book, everything is clear for me.
Hai
Originally posted by Sivaraman Lakshmanan:
hi all,
I can always put a index.jsp in the web-apps/ROOT folder which can
just refresh my page, but I want to know where it is configured that by
default tomcat request (on typing
http://localhost:8080/) goes to web-apps/ROOT folders index.jsp
Regards,
Sivaraman.L