0
votes

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.

2
This probably depends on how you have configured Eclipse to deploy your application. What server are you running? - Jeremy
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
@javamonkey: yes, thats the way to go from. i tought it was strtus2 specific. tnx! - vale4674

2 Answers

0
votes

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
votes

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.