Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display a default page?

Status
Not open for further replies.

taneujin

MIS
Aug 14, 2001
61
0
0
SG
I am new to Tomcat and would like to know some configurations.

I have a directory called /test and I want a page in a subfolder in /test (/test/test2/login.jsp) to be displayed when I access the server when I type
May I know what I should do?

(I have already changed the port from 8080 to 80)
 

One way to do it is to use the response.sendRedirect() method.

When you log in to tomcat the first time it goes to the /ROOT/index.jsp page. I suppose that you have changed it because it is irrelevant to your production website needs.

Replace /ROOT/index.jsp with another file with same name having the following contents:

<%
response.sendRedirect(&quot;test/test2/login.jsp&quot;);
%>

-------------------------
This should do the trick.

HttpServletResponse.sendRedirect() sends a 300 level message/command back to the client telling it to make a new request to the indicated URL.

Best Regards, pfist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top