[TOMCAT] I want to hide "/index.jsp" and having "/" at the root of my site

Discussion in 'Java' started by Frogger, Oct 6, 2003.

  1. Frogger

    Frogger Guest

    Frogger, Oct 6, 2003
    #1
    1. Advertising

  2. Frogger

    RGonzalez Guest

    in conf/web.xml look at this:

    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>


    These are the default URI in order it will look for when browsing to your
    site at "/".

    "Frogger" <> wrote in message
    news:blsobh$am9$...
    > Hi,
    >
    > I have a webapp with a welcome file called "index.jsp".
    >
    > When i visit my site http://www.mysite.com/ , it convert the url in
    > http://www.mysite.com/index.jsp !!
    >
    > I don't want to see index.jsp but only "/"
    >
    > Can you help me ? Thanx
    >
    >
    >
    >
     
    RGonzalez, Oct 7, 2003
    #2
    1. Advertising

  3. Dont understant why you could want that, but:
    - Remove <welcome-file>
    - Add a servlet mapping for / to a servlet (say Welcome)
    - In the servlet Welcome, just forward
    (Servletcontext;getRequestdispatcher, etc...) to index.jsp

    I did not try that, but I know that when using a requestDispatcher, only
    original request is seen by the browser. Maybe it could work ;-)

    "Frogger" <> a écrit dans le message de
    news:blsobh$am9$...
    > Hi,
    >
    > I have a webapp with a welcome file called "index.jsp".
    >
    > When i visit my site http://www.mysite.com/ , it convert the url in
    > http://www.mysite.com/index.jsp !!
    >
    > I don't want to see index.jsp but only "/"
    >
    > Can you help me ? Thanx
    >
    >
    >
     
    Xavier Tarrago, Oct 7, 2003
    #3
  4. Frogger

    Wendy S Guest

    "Frogger" <> wrote in message
    news:blsobh$am9$...
    > I have a webapp with a welcome file called "index.jsp".
    > When i visit my site http://www.mysite.com/ , it convert the url in
    > http://www.mysite.com/index.jsp !!
    > I don't want to see index.jsp but only "/"
    > Can you help me ? Thanx


    Tomcat (4.1 at least) does this on purpose, the behavior was put in as part
    of a bug fix in an earlier version and you can't turn it off. There was
    talk on tomcat-dev of making it configurable (redirect vs. forward) in 5.0
    but I have no idea if it went in or not. Search the tomcat-user or
    tomcat-dev mailing list archives for more info.

    Info on why it's that way, quoted from the Tomcat source:
    http://w6.metronet.com/~wjm/tomcat/2001/Apr/msg00251.html

    Here's an article that tells how to patch the Tomcat source to make it stop
    redirecting:
    http://www.spaceprogram.com/knowledge/fixingtomcat_302problem.html

    You can run Apache in front of Tomcat and probably get rid of the URL change
    that way.

    --
    Wendy in Chandler, AZ
     
    Wendy S, Oct 7, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,241
  2. Craig H.
    Replies:
    0
    Views:
    1,759
    Craig H.
    Apr 1, 2004
  3. Sean Berry
    Replies:
    3
    Views:
    4,557
    Tim Terry
    Dec 19, 2005
  4. tiewknvc9
    Replies:
    4
    Views:
    1,764
  5. Ed Redman
    Replies:
    1
    Views:
    112
    Morton Goldberg
    Sep 20, 2007
Loading...

Share This Page