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: M开发者_Python百科yProject
Url: http://localhost:8080/MyProject
now I want to change that url to: http://localhost:8080/Project, but keep project name MyProject
tnx.
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>
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.
精彩评论