seen234 — 2010-04-15T12:36:52-04:00 — #1
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.
vinoth1986 — 2010-08-24T06:18:37-04:00 — #2
I think you should do it in web.xml, just override the default welcome file list
Because if you do it in server.xml then it will set default page for all the webapplications in tomcat
hooknc — 2010-04-15T13:15:33-04:00 — #3
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.
seen234 — 2010-04-15T13:48:31-04:00 — #4
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..
seen234 — 2010-04-15T14:04:45-04:00 — #5
Nevermind, it works.. thanks!
I had left the server.xml file open, and I guess that was causing the errors.
hooknc — 2010-04-15T18:48:11-04:00 — #6
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.
hooknc — 2010-04-16T11:33:36-04:00 — #7
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\ mp0\conf\server.xml file to be edited directly for server changes to take affect.