首页 软件开发 代码片段 groovy ( Page 6 )

groovy 77

#Groovy
grails的UrlMapping常用配置示例

class UrlMappings { //grails框架不处理以下请求,也就是不经过grails的Controller,由web服务器处理 static excludes = …

2015-12-14 823

#Groovy
groovy同时迭代多个List

def list1 = [1, 2, 3] def list2 = [4, 5, 6] def result = true list1.eachWithIndex { n, i -…

2015-12-14 448

#Groovy
删除文件

//---------------------------------------------------------------------------------- print…

2015-12-14 669

#Groovy
微信SHA1验证

String token = "QDG6eK"; String timeStamp = "1409659589"; String nonce = "263014780"; Stri…

2015-12-14 967

#Groovy
Groovy @Log 的用法

import groovy.util.logging.* import java.util.logging.Level @Log("log2") class Car { Car()…

2015-12-14 568

#Groovy
grails配置jndi数据源

dataSource { jndiName = "java:comp/env/jdbc/lugua" //或 jndiName = "jdbc/lugua" 视你的jee容器jnd…

2015-12-14 935

#Groovy
Groovy用inject方法构造Map

def a = [1, 2, 3] def b = [4, 5, 6] def m = [:] [a, b].transpose().each { k, v -> m += …

2015-12-14 906

#Groovy
扫描端口小工具

package org.sl.util /** * Created by shanl on 14-3-18. */ class ScanPort implements Runnab…

2015-12-14 240

#Groovy
Grails 文件上传

<g:form action="save" method="post" enctype="multipart/form-data"> <input type="f…

2015-12-14 1,004

#Groovy
groovy 方式 写的qt时钟代码

/** * */ package com.suziwen import com.trolltech.qt.core.QPoint import com.trolltech.qt.c…

2015-12-14 539

#Groovy
grails默认全局gorm配置

//默认实体约束 grails.gorm.default.constraints = { '*'(nullable:true, blank:true) } //默认映射 grail…

2015-12-14 445

#Groovy
Groovy实现Ruby的case .. when表达式

def match(subject, closure) { def whenMap = [:], otherwise = null closure.when = { map -&g…

2015-12-14 377