Java - How to change context root of a dynamic web project in eclipse
来源:互联网 发布:中商情报网数据可靠吗 编辑:程序博客网 时间:2024/06/05 18:32
I'm sure you've moved on by now, but I thought I'd answer anyway.
Some of these answers give work-arounds. What actually must happen is that you clean and republish your project to "activate" the new URI. This is done by right-clicking your server (in the Servers view) and choosing Clean. Then you start (or restart it). Most of the other answers here suggest you do things that in effect accomplish this.
The file that's changing is workspace/.metadata/.plugins/org.eclipse.wst.server.core/publish/publish.datunless, that is, you've got more than one server in your workspace in which case it will be publishN.dat on that same path.
Hope this helps somebody.
Not sure if this is proper etiquette or not -- I am editing this answer to give exact steps for Eclipse Indigo.
(1) In your project's Properties, choose "Web Project Settings".
(2) Change "Context root" to "app".
(3) Choose Window > Show View > Servers.
(4) Stop the server by either clicking the red square box ("Stop the server" tooltip) or context-click on the server listing to choose "Stop".
(5)On the server you want to use, context-click to choose "Clean…".
(6) Click OK in this confirmation dialog box.
Now you can run your app with the new "app" URL such as:
http://localhost:8080/app/
Doing this outside of Eclipse, on your production server, is even easier --> Rename the war file. Export your Vaadin app as a WAR file (File > Export > Web > WAR file). Move the WAR file to your web server's servlet container such as Tomcat. Rename your WAR file, in this case to "app.war". When you start the servlet container, most such as Tomcat will auto-deploy the app, which includes expanding the war file to a folder. In this case, we should see a folder named "app". You should be good to go. Test your URL. For a domain such as "example.com" this would be: http://www.example.com/app/
Thanks so much to Russ Bateman for posting the correct answer to this frustrating problem.
Vaadin toolkit programmers may need to rebuild their widget set if using visual add ons.
--Basil Bourque
原地址 :http://stackoverflow.com/questions/2437465/java-how-to-change-context-root-of-a-dynamic-web-project-in-eclipse
- Java - How to change context root of a dynamic web project in eclipse
- How to change context root of a dynamic web project in Eclipse
- maven Cannot change version of project facet Dynamic Web Module to 3.0 Error in Eclipse
- Converting a Java Project to a Dynamic Web Project in Eclipse
- Eclipse中修改java、web module版本cannot change version of project facet Dynamic web module to 3.0
- eclipse web module版本问题:Cannot change version of project facet Dynamic Web Module to 2.5.
- eclipse web module版本问题:Cannot change version of project facet Dynamic Web Module to 2.5.
- eclipse 创建maven web错误Cannot change version of project facet Dynamic Web Module to 3.1.
- Cannot change version of project facet Dynamic Web Module to 3.1 (Eclipse Maven唯一解决方案)
- Eclipse EE Cannot change version of project facet Dynamic web module to 3.0
- 【Maven-Eclipse】Cannot change version of project facet Dynamic Web Module to 2.5.
- Eclipse-JEE解决Cannot change version of project facet Dynamic web module to 2.4
- eclipse maven cannot change version of project facet Dynamic web module to 3.1
- Eclipse 中Connot change version of project factet Dynamic Web Module to 3.0 处理
- eclipse报红叉,解决Cannot change version of project facet Dynamic web module to 2.5
- Eclipse解决Cannot change version of project facet Dynamic Web Module to 3.0.
- java web项目 bug --canot change version of project facet dynamic web module to **
- eclipse如何修改dynamic web module version -Cannot change version of project facet Dynamic Web Module to
- WPF ToolTip
- POI1998 ATM 自动取款机
- 类之间的三种基本关系
- RSA加密算法的基本原理
- helloOpenCV
- Java - How to change context root of a dynamic web project in eclipse
- static_cast, const_cast, dynamic_cast和reinterpret_cast
- 【转载】GIT服务器使用手册说明
- 什么是信息系统
- PHP 获取同一个name多个复选框的值
- Netgear wndr3700v2 路由器刷OpenWrt打造全能服务器(十二)恢复
- IOS_自定义UIButton的子视图位置 EdgeInsets属性
- 排序/查找 156 - Ananagrams
- Eclipse和PyDev搭建完美Python开发环境(Windows篇)