UrlMapping to Index无效

时间:2017-12-05 02:11:04

标签: grails

我正在尝试获取我的索引,在我的情况下只是localhost:8080转到另一页。这段代码不起作用,我只是去索引页面而不是渲染“this working”

我的UrlMappings文件如下所示:

package appworld

class UrlMappings {

    static mappings = {

        "/$controller/$action?/$id?(.$format)?"{
            constraints {
                // apply constraints here
            }
        }

        "/" {
            controller = "Home"
            action = "isUserLoggedIn"
        }

        "500"(view:'/error')
        "404"(view:'/notFound')
    }
}

HomeController.groovy中的方法如下:

def isUserLoggedIn() {
   println("We made it from index")
   render "this worked"
}

1 个答案:

答案 0 :(得分:1)

看起来您的语法已关闭。尝试:

SELECT
    SUM(I_2012)
FROM 
(
    SELECT DISTINCT
        LAT,
        LON,
        I_2012
    FROM
        INSURANCE
    GROUP BY
        I_2011
    HAVING
        COUNT(*) > 1
);