The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

tomcat servlet being the 'directoryindex' file

Discussion in 'General Discussion' started by bking, Jun 7, 2006.

  1. bking

    bking Well-Known Member

    Joined:
    Mar 1, 2004
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney
    I have a client who wishes to have his servlets served as if they were part of the apache DirectoryIndex directove.

    For example, they have a servlet called Main.do they want to enter http://www.domain.com/ and have this servlet show up.

    as Main.do is a servlet and NOT a file as such, there is no such file called Main.do on the filesystem. So apache does not show this file.

    Currently we have an index file with a meta refresh tag to redirect to /Main.do
    Apache has JkMount /*.do ajp13 in its config file, so when the refresh occurs, it quite cheerfully sends the request of to tomcat and the website is displayed fine.

    basicallty we want the Main.do file to be displayed without explicitly writing it in teh URL, much the same as a normal DirectoryIndex occurs.

    Is this a possibility with the way Tomcat is configured in cpanel?
    (Hope I have not confused...)
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    It doesn't work with the DirectoryIndex directive in an .htaccess file?
     
  3. bking

    bking Well-Known Member

    Joined:
    Mar 1, 2004
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney
    Nah.. Because DirectoryIndex expects a file with the name Main.do to exist. But as it is a servlet, there is really no such filename on the server anywhere...
    apache just see's the *.do and passes it back to comcat to deal with..
     
  4. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Ah. I see.
    I looked at one of my clients' pages and he was doing a redirect, too.
    I don't know the details of how to use tomcat, but a .do index should be doable. Maybe with the welcome-page directive in web.xml?
     
  5. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
  6. bking

    bking Well-Known Member

    Joined:
    Mar 1, 2004
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney
    Have not used the jsp forward etc.. he wants to get away from the whole redirect/forward thing because he feels that search engines are not rating his site enough due to the redirects/forwards.

    As for the URL you sent, I have pointed him to it.. Will see what comes of it.

    This issue is all about making the site more 'search engine friendly' as apparently sites with redirects do not rank as high as others...and his site has all been coded around the servlet stuff.

    Thanks for your suggestions though! Much appreciated. Will see how we go :)
     
Loading...

Share This Page