《Spring-MVC-step-by-step.pdf》第一个例子遇到的路径问题
参考 《Spring-MVC-step-by-step.pdf》
一步一步开发 Spring Framework MVC 应用程序
作者:Thomas Risberg 2003年7月(2005年4月修订)
问题:ant deploy 虽然成功,但是没有发布到 tomcat 路径下:
F:\setup\eclipse-adt-bundle-32bits\project\Spring-MVC-step-by-step\springapp_step_1>ant deploy
Buildfile: F:\setup\eclipse-adt-bundle-32bits\project\Spring-MVC-step-by-step\springapp_step_1\build.xml
build:
[javac] F:\setup\eclipse-adt-bundle-32bits\project\Spring-MVC-step-by-step\springapp_step_1\build.xml:41: warning: 'includeantruntime' was not set, defaulti
ng to build.sysclasspath=last; set to false for repeatable builds
deploy:
[copy] Copying 23 files to F:\setup\eclipse-adt-bundle-32bits\project\Spring-MVC-step-by-step\springapp_step_1\R_AND_Djavaspring_mvcsoftwareapache-tomcat-7.0.70\webapps\springapp
BUILD SUCCESSFUL
Total time: 0 seconds
无论如何修改 build.properties 都不行。
build.properties 是这样写的:
appserver.home=F:\R_AND_D\java\spring_mvc\software\apache-tomcat-7.0.70
deploy.path=${appserver.home}/webapps
我的工程路径 F:\setup\eclipse-adt-bundle-32bits\project\Spring-MVC-step-by-step\springapp_step_1
我的tomcat路径 F:\R_AND_D\java\spring_mvc\software\apache-tomcat-7.0.70
我期待的发布路径应该是: F:\R_AND_D\java\spring_mvc\software\apache-tomcat-7.0.70\webapps
实际的发布路径 F:\setup\eclipse-adt-bundle-32bits\project\Spring-MVC-step-by-step\springapp_step_1\R_AND_Djavaspring_mvcsoftwareapache-tomcat-7.0.70\webapps
即变成了我工程的路径 + tomcat 拼接后的路径。
是不是只有WINDOWS下才有这个问题?
当然我手工拷贝发布目录到 F:\R_AND_D\java\spring_mvc\software\apache-tomcat-7.0.70\webapps 后
http://localhost:8080/springapp_step_1/ 可以正常显示:
Example - Spring Application
This is my test.