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

groovy 77

#Groovy
用switch 优化 if-else 代码

// before def fun1(a, b, c) { println("-----------------------") if (a > b || a > c)…

2015-12-14 839

#Groovy
检索页面URL地址

new URL("http://www.oschina.net").openConnection().content.text.eachMatch( /href="(http.+?…

2015-12-14 637

#Groovy
grails的UrlMapping常用配置示例

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

2015-12-14 793

#Groovy
groovy同时迭代多个List

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

2015-12-14 428

#Groovy
删除文件

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

2015-12-14 650

#Groovy
微信SHA1验证

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

2015-12-14 951

#Groovy
Groovy @Log 的用法

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

2015-12-14 538

#Groovy
grails配置jndi数据源

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

2015-12-14 915

#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 889

#Groovy
扫描端口小工具

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

2015-12-14 220

#Groovy
Grails 文件上传

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

2015-12-14 987

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

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

2015-12-14 521