Original article, reproduced please indicate the source: http://blog.csdn.net/huxiweng/article/details/9283961
The play framework has its own server and can be deployed on other servers. Deploy the play project to Tomcat.
1. Prepare the war package
First, go to the play directory:
For example, my:
cd C:\play-1.2.5\play-1.2.5
Run the following command: play war [absolute path of the project]-O [generated war package name (including path)]
Note that it is best to specify other directories for the generated war package, such as the C root directory.
For example, my project:
C:\play-1.2.5\play-1.2.5>play war C:\msysgit\msysgit\git\gitrep7\applyful\modules\applyful.appserver_v2 -o c:\applyful.war~ _ _~ _ __ | | __ _ _ _| |~ | '_ \| |/ _' | || |_|~ | __/|_|\____|\__ (_)~ |_| |__/~~ play! 1.2.5, http://www.playframework.org~CompilerOracle: exclude jregex/Pretokenizer.nextListening for transport dt_socket at address: 800017:19:22,085 INFO ~ Starting C:\msysgit\msysgit\git\gitrep7\applyful\modules\applyful.appserver_v217:19:22,085 INFO ~ Module japid is available (C:\msysgit\msysgit\git\gitrep7\applyful\modules\applyful.appserver_v2\modules\japid-0.9.4.3)17:19:22,085 INFO ~ Module morphia is available (C:\msysgit\msysgit\git\gitrep7\applyful\modules\applyful.appserver_v2\modules\morphia-1.2.9a)17:19:22,101 INFO ~ Module press is available (C:\msysgit\msysgit\git\gitrep7\applyful\modules\applyful.appserver_v2\modules\press-1.0.25)17:19:24,191 INFO ~ JapidPlugin.onload().17:19:24,191 INFO ~ [Japid] play in DEV mode. Detecting changes...[Japid] Processing 15 templates in directory tree: C:\msysgit\msysgit\git\gitrep7\applyful\modules\applyful.appserver_v2\app[Japid] Transforming template: japidviews\OnboardingController\step2.html to: step2.java[Japid] Transforming template: japidviews\OnboardingController\step5.html to: step5.java[Japid] Transforming template: japidviews\OnboardingController\step4.html to: step4.java[Japid] Transforming template: japidviews\PageController\about.html to: about.java[Japid] Transforming template: japidviews\SchoolController\page_more_info.html to: page_more_info.java[Japid] Transforming template: japidviews\Landing\index.html to: index.java[Japid] Transforming template: japidviews\PageController\createPage.html to: createPage.java[Japid] Transforming template: japidviews\OnboardingController\finishedProfile.html to: finishedProfile.java[Japid] Transforming template: japidviews\_tags\pagelike.html to: pagelike.java[Japid] Transforming template: japidviews\AccountController\signupresult.html to: signupresult.java[Japid] Transforming template: japidviews\_layouts\step_layout.html to: step_layout.java[Japid] Transforming template: japidviews\_layouts\new_signupresult_layout.htmlto: new_signupresult_layout.java[Japid] Transforming template: japidviews\_layouts\signupresult_layout.html to:signupresult_layout.java[Japid] Transforming template: japidviews\OnboardingController\step3.html to: step3.java[Japid] Transforming template: japidviews\OnboardingController\step1.html to: step1.java17:19:24,847 INFO ~ Precompiling ...17:19:44,440 INFO ~ Done.~ Packaging current version of the framework and the application to c:\applyful.war ...~ Done !~~ You can now load c:\applyful.war as a standard WAR into your servlet container~ You can't use play standard commands to run/stop/debug the WAR application...~ ... just use your servlet container commands instead~~ Have fun!~C:\play-1.2.5\play-1.2.5>mongod
2. Deploy to Tomcat
Copy the WEB-INF file in the obtained war folder to the root under the Tomcat directory and overwrite it directly.
Start tomcat to access: http: // localhost: 8080/