gsp--Groovy Servers Pages <g:actionSubmit value=""/> 提交按钮 <g:actionSubmit action="Edit" value="Some label for editing" /> <g:actionSubmitimage value=""/> 图像提交按钮 <g:actionSubmitimage src="/images/submitButton.gif" action="Edit" /> <g:applyLayout></g:applyLayout> 创建layout <g:applyLayout name="myLayout">some text</g:applyLayout> <g:applyLayout name="myLayout" template="mytemplate" /> <g:applyLayout name="myLayout" url="http://www.google.com" /> <g:applyLayout name="myLayout" action="myAction" controller="myController"> <g:checkBox name=""/>复选框 <g:collect></g:collect>枚举一个集合并根据定义的expr参数改变结果 <g:cookie name=""/>得到一个cookie的值 <g:country code=""/>根据国家代码输出国家名称 <g:countrySelect/> 显示国家选择下拉框combo Box <g:countrySelect name="myCountry" value="${country}" /> <g:createLink/>从一组属性里创建一个Grails应用链接 <g:createLinkTo/> 创建一个链接到资源<link type="text/css" href="${createLinkTo(dir:'css',file:'main.css')}" /> <g:currencySelect/> 显示币种选择下拉框combo Box <g:currencySelect name="myCurrency" value="${currency}" /> <g:datePicker name=""/> 日期选择器 <g:datePicker name="myDate" value="${new Date()}" /> <g:def/>在gsp文件中定义变量,作为<set>的替代 <g:each></g:each>遍历指定集合中的每个对象 <g:eachError></g:eachError>循环遍历每个错误指定的bean或model <g:else></g:else>else <g:elseif></g:elseif>else if <g:encodeAs codec=""></g:encodeAs>指定编码格式的encode <g:escapeJavascript></g:escapeJavascript> <g:escapeJavascript>This is some "text" to be escaped</g:escapeJavascript> <g:external/> Render the appropriate kind of external link for use in <head> based on the type of the URI. For JS will render <script> tags, for CSS will render <link> with the correct rel,and so on for icons. <g:field type=""/> 创建field <g:fieldError bean="" field=""></g:fieldError>显示错误信息 <g:fieldError bean="${book}" field="title" /> <g:fieldValue bean="" field=""/>得到字段的值 <g:fieldValue bean="${book}" field="title" /> <g:findall></g:findall> findall method <g:form></g:form>Form <g:form action="myaction">...</g:form> <g:form controller="myctrl" action="myaction">...</g:form> <g:formatBoolean boolean=""/> 输出给定布尔作为指定的文本标签。如果true和false选项没有给出判断,然后使用默认的标签输出。 <g:formatBoolean boolean="${myBoolean}" /> <g:formatBoolean boolean="${myBoolean}" true="True!" false="False!" /> <g:formatDate/>输出指定的日期格式 <g:formatDate date="${myDate}" format="yyyy-MM-dd HH:mm" /> <g:formatNumber number=""/>输出指定的数字格式 <g:formatNumber number="${myNumber}" format="###,##0" /> <g:formRemote name="" url=""></g:formRemote> 使用JavaScript提供序列化参数并提交通过ajax异步调用。 <g:grep></g:grep>过滤 采用常规的JDK grep方法遍历每个元素指定对象的符合规定的“过滤”属性。 过滤器可以是不同的实例,如类,正则表达式模式等。 <g:hasErrors></g:hasErrors>检查是否有错 <g:header name=""/>请求name的值? <g:hiddenField name=""/>隐藏的field <g:if></g:if>if <g:ifPageProperty name=""></g:ifPageProperty> 若页面属性存在,则.. <g:ifPageProperty name="Meta.index">body to invoke</ g:ifPageProperty> <g:ifPageProperty name="Meta.index" equals="blah">body to invoke</g:ifPageProperty> <g:img/>显示照片 <g:include/>存在另一个controller/action在当前response中 <g:include controller="foo" action="test"></g:include> <g:javascript></g:javascript>js脚本 <g:javascript>alert('hello')</g:javascript> <g:join/>连接字符串 <g:layoutBody/>显示Body <g:layoutHead/>显示Head <g:layoutTitle/>显示Title <g:layoutTitle default="The Default title" /> <g:link></g:link>link <g:localeSelect name="myLocale" value="${locale}" />locate 所在区域 <g:message/>显示错误消息 <g:Meta name=""/>从application.properties load application Metadata <g:pageProperty/>显示页面属性 <g:pageProperty default="defaultValue" name="body.onload" /> <g:paginate total=""/>分页 <g:paginate total="${Account.count()}" /> <g:passwordField name=""/>密码文本框 <g:radio name="" value=""/>radio button 单选按钮 <g:radioGroup values="" name=""></g:radioGroup>radio button group 一组单选按钮 <g:remoteField name=""/> remote link <g:remoteFunction/> remote function <g:remoteLink></g:remoteLink> remote link <g:render template=""></g:render>渲染图中集合的一个模板 <g:render template="atemplate" collection="${users}" /> <g:render template="atemplate" model="[user:user,company:company]" /> <g:render template="atemplate" bean="${user}" /> <g:renderErrors/>显示错误 <g:renderException exception=""/>显示异常 <g:renderInput></g:renderInput>显示输入? <g:resource/>创建一个链接到资源 <link type="text/css" href="${resource(dir:'css',file:'main.css')}" /> <g:select name="" from=""/>dropdown list下拉列表 <g:select name="user.age" from="${18..65}" value="${age}" /> <g:select name="user.company.id" from="${Company.list()}" value="${user?.company.id}" optionKey="id" /> <g:set></g:set>给变量赋值 <g:setProvider></g:setProvider>set provider <g:sortableColumn/>可排序的column <g:sortableColumn property="title" title="Title" /> <g:sortableColumn property="title" title="Title" style="width: 200px" /> <g:sortableColumn property="title" titleKey="book.title" /> <g:sortableColumn property="releaseDate" defaultOrder="desc" title="Release Date" /> <g:sortableColumn property="releaseDate" defaultOrder="desc" title="Release Date" titleKey="book.releaseDate" /> <g:submitButton name=""/>提交按钮 <g:submitToRemote></g:submitToRemote>Ajax提交按钮 <g:textArea name=""></g:textArea>textarea <g:textField name=""/> textfield <g:timeZoneselect name=""/>所在区域的时区 <g:timeZoneselect name="myTimeZone" value="${tz}" /> <g:unless></g:unless>除非 <g:uploadForm></g:uploadForm>上传表单 <g:validate form="" againstClass=""></g:validate>验证 <g:while></g:while>while <g:withTag name=""></g:withTag>创建标签
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。