, groovlets , Servlet Groovy scripting,
, Grails - controller HTML GSP.
- ( , ):
Grails-//SampleController.groovy
class DateController {
def index = {
if (session == null) {
session = request.getSession(true);
}
if (session.counter == null) {
session.counter = 1
}
}
}
-//index.gsp
<html>
<head>
<title>Groovy Servlet</title>
</head>
<body>
Hello, ${request.remoteHost}: Counter: ${session.counter}! Date: ${new Date()}
<br>
, !