开发者

Struts2, change project's web browser URL?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜