Play! (Windows ):
Download the file http://www.playframework.org/download the latest installation package, play-1.2.3.zip
Decompress the package to the local folder, for example, D: \ play \
Set the environment variable path to the installation directory, open the window command line: Enter play, and the play will be output! Indicates that the installation is successful.
Play! Create a project:
Open the window command line and enter the directory of the project to be saved. Play new MyApp requires that the project description be entered. after entering the description, the project is created. The specific directory is as follows:
APP: controller, model, and view
Conf: including application. conf, dependencies. yml (dependent on modules configuration), routes, and messages Message configuration file
Lib: jar package
Public: Where JS, CSS, and images are stored.
Test: The test code.
The overall structure is clear.
Play! Project run test:
You have created a new project and run it easily. Enter play run MyApp in the command line. If it is already in the project directory, you do not need to add the project name.
You can see the server startup information. After the server is started successfully, it can be opened in the browser, http: // localhost: 9000
Modify APP/controllers/application. Java
Java code
- Public class application extends controller {
- Public static void index (){
- Render ()
- }
- }
Modify the code in the index method to see the effect in the browser.
Test Run Mode: Play test MyApp
Reference: http://www.playframework.org/documentation/1.2.3/overview
Use ide tools:
Directly run the command line to enter the project directory and enter play javassify to generate the Eclipse project file. Then, import the project in eclipse,
Run the project in Eclipse: Right-click Eclipse/MyApp. Launch and run it.
The other two
Test MyApp. Launch is run in Test Mode
Connect JPDA to MyApp. Launch is in debug mode. (You Need To Run MyApp. Launch first, and then run this operation to debug mode)
Others can refer to http://www.playframework.org/documentation/1.2.3/ide
Play! You can go to the official document http://www.playframework.org/documentation/1.2.3/homefor further study. For more information, see play! Examples provided in the installation directory (installation directory: \ play \ samples-and-tests)