• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

setting index.html to my context root

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
Im using tomcat 4.0.. My context root is "raj"
wat i want is when i enter the url
http://localhost:8080/index.html
i want the to invloke the login.jsp file inside the ..webapps/raj directory
by default
http://localhost:8080/index.html
will go to webapps/root/index.html right ?
can any1 guide me ?

thanks,
raj
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With just Tomcat stand-alone, you'd need to replace the root context.

Currently, you have an entry like this...
<Context path="" docBase="ROOT" debug="0"/>

You'd need to make it:
<Context path="" docBase="raj" debug="0"/>

So that any requests for "" as a context are routed to your raj context.

Regarding index.html
I'd put nothing but a single META tag in this page, and it would redirect the browser to login.jsp

But what if they just type:
http://localhost:8080/
(without the index.html)

You'd need to use the welcome-file list in web.xml. Your one entry could be login.jsp
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Mike..
this is wat i was looking for....
Thanks,
raj
 
Sheriff
Posts: 67504
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another technique would be to have your index.html simply redirect to the appropriate location.
hth,
bear
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi bear,
could u tell me how redirect is done in html page ?? if it is a jsp, then only we can use the redirect method right ??
Thanks,
raj
 
Bear Bibeault
Sheriff
Posts: 67504
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you could do it with a JSP scriptlet in a JSP (by adding index.jsp to your welcome file list), but in pure HTML I was thinking along the lines of the meta tag:

The 0 indicates the time (in seconds) to delay before the redirect (in this case, none).
hth,
bear
[ April 25, 2003: Message edited by: Bear Bibeault ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic