(Quick Reference)

6.2.1.3 页面指令 - Reference Documentation

Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith

Version: null

6.2.1.3 页面指令

GSP also supports a few JSP-style page directives.

The import directive lets you import classes into the page. However, it is rarely needed due to Groovy's default imports and GSP Tags:

<%@ page import="java.awt.*" %>

GSP also supports the contentType directive:

<%@ page contentType="text/json" %>

The contentType directive allows using GSP to render other formats.

GSP也支持一些JSP风格的页面指令。

import指令可以让你将Java类导入到页面中。但是它应该很少使用,因为已经有Groovy缺省导入和GSP标签

<%@ page import="java.awt.*" %>

GSP也支持contentType指令:

<%@ page contentType="text/json" %>

contentType指令允许将GSP渲染为其他格式。