SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2010
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    webapps with tomcat

    Hi gurus,

    I'm not sure if this is the right forum for this but here goes:

    I have an servlet/jsp webapp called "intro". Via Tomcat, the link is www.mysite.com/intro.

    I'm developing this app in Eclipse. How can I change the name of the extension, so that the link will be www.mysite.com/newName?

    I tried to google this, and came across refactoring but that didn't work.. thanks in advance.

  2. #2
    SiteP0int Weazle hooknc's Avatar
    Join Date
    Dec 2004
    Location
    Socialist Republic of Boulder
    Posts
    937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe you're talking about your sites context?

    So, do you have www.mysite.com/intro/index.jsp working? OR do you have www.mysite.com/intro.jsp working?

    And do you want www.mysite.com/newname/index.jsp working?

    If so, that is a setting in your tomcat server.xml under the <context> section.

    You would rename your "path" from path="/intro" to path="newname".


    Also if you setup a J2EE type project in eclipse you can edit your .settings/org.eclipse.wst.common.component file and change the "context-root" property and then perform a clean... on your Server so that everything gets re-published properly.
    baby steps... baby steps...

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2010
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick response!

    I apologize for not specifying, in the address bar the user would only have to type in www.mysite.com/intro and the page that actually loads is www.mysite.com/intro/index.html

    I tried your solution. Under the context in server.xml I changed the path to /newname instead of /intro, but then when restarting the server I received this error:

    "Could not load the Tomcat server configuration at \Servers\Tomcat v6.0 Server at localhost-config. The configuration may be corrupt or incomplete."

    If I changed the path back to /intro instead of /newname the server will once again work..

    Thoughts? Many thx..

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2010
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, it works.. thanks!

    I had left the server.xml file open, and I guess that was causing the errors.

  5. #5
    SiteP0int Weazle hooknc's Avatar
    Join Date
    Dec 2004
    Location
    Socialist Republic of Boulder
    Posts
    937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually after editing your server.xml file in eclipse (Servers/Tomcat v6.0 Server at localhost-config/server.xml) I found that I have to do a (right click) Clean... (and republish) on that server in the Server tab.

    Only after doing a clean/republish will your newly edited server.xml file take effect.

    Glad everything worked out for you.
    baby steps... baby steps...

  6. #6
    SiteP0int Weazle hooknc's Avatar
    Join Date
    Dec 2004
    Location
    Socialist Republic of Boulder
    Posts
    937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I forgot to mention that the above posts work only for the Galileo release of Eclipse.

    It seems to me that previous versions of Eclipse required the .metadata\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml file to be edited directly for server changes to take affect.
    baby steps... baby steps...

  7. #7
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you should do it in web.xml, just override the default welcome file list
    Code:
    <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    Because if you do it in server.xml then it will set default page for all the webapplications in tomcat


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •