0

Struts2, eclipse.

Is there another way of changing the project's web browser url, except of renaming the project?

Example:

My dynamic web page project name: MyProject

Url: http://localhost:8080/MyProject

now I want to change that url to: http://localhost:8080/Project, but keep project name MyProject

tnx.

skaffman
  • 398,947
  • 96
  • 818
  • 769
vale4674
  • 4,161
  • 13
  • 47
  • 72
  • This probably depends on how you have configured Eclipse to deploy your application. What server are you running? – Jeremy Dec 04 '10 at 01:41
  • 3
    Possible duplicate: http://stackoverflow.com/questions/2437465/java-how-to-change-context-root-of-a-dynamic-web-project-in-eclipse – javamonkey79 Dec 04 '10 at 02:03
  • This question isn't Struts2 specific. You will want to figure out how to change the context path for your web application. javamonkey's link may be your best first step. – Steven Benitez Dec 04 '10 at 04:11
  • @javamonkey: yes, thats the way to go from. i tought it was strtus2 specific. tnx! – vale4674 Dec 04 '10 at 13:44

2 Answers2

0

I think you can change the url pattern in the web.xml which will do the trick.

<servlet-mapping>
        <url-pattern>/project</url-pattern>
        <servlet-name>project</servlet-name>
</servlet-mapping>
0

Your question is application server / servlet container specific. You should lookup relevant infromation about context path, this is what defines your application's URL after host and port name.

In your example, http://localhost:8080/MyProject, context path is MyProject and you must change that in your app. server / container configuration.

darioo
  • 46,442
  • 10
  • 75
  • 103