文章列表
代码如下:
def chatSave(){
def data = params.data
println data
def slurper = new JsonSlurper()
def result=slurper.parseText(data)
println result
def chat = new Chat()
chat.fid = result.fid
chat.tid = result.tid
chat.msg = result.msg
chat.roomId = result.roomId
chat.type = result.typ ...
控制器代码
def saveSurvey(){
println params
def person = Person.findByUserID(params?.userID)
def progress = Progress.get(params?.proid)
def activitylist=Activity.findAllByProgress(progress)
def questions=Questions.findAllByActivity(activitylist)
params.each {key,val ->print val
if(is ...
1用JAVA自带的函数
public static boolean isNumeric(String str){
for (int i = str.length();--i>=0;){
if (!Character.isDigit(str.charAt(i))){
return false;
}
}
return true;
}
2用正则表达式
public static boolean isNumeric(String str){
Pattern pattern = Pattern.compile("[0-9]*") ...