码迷,mamicode.com
首页 > 其他好文 > 详细

Play Framework新增子页面方法

时间:2019-03-14 15:11:00      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:priority   pre   增加   .com   fine   配置   file   public   http   

例如我想增加

http://localhost:9000/hello

首先为Application.java新增一个方法

1 public static void hello() {
2         render();
3     }

之后在/app/views/Application下新增hello.html文件

最后配置conf/routes新增
GET     /hello                                      Application.hello

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET     /                                       Application.index
GET     /hello                                      Application.hello

# Ignore favicon requests
GET     /favicon.ico                            404

# Map static resources from the /app/public folder to the /public path
GET     /public/                                staticDir:public

# Catch all
*       /{controller}/{action}                  {controller}.{action}

之后重新启动项目,即可成功

技术图片

 

Play Framework新增子页面方法

标签:priority   pre   增加   .com   fine   配置   file   public   http   

原文地址:https://www.cnblogs.com/xfww/p/10530220.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!