![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
grails
wendawu
这个作者很懒,什么都没留下…
展开
-
Run a Java web application within grails
Ever needed to run an existing java web application side by side with your grails project? I found myself in exactly that position this week, and discovered that it (like most things in grails) was ra...原创 2011-08-27 13:22:46 · 90 阅读 · 0 评论 -
Grails, JQuery, and AJAX
By now, you’re probably under the impression that I love Grails, and you wouldn’t be far off from the truth. Ever since I started using it almost a year ago, I’ve continually been amazed by just how d...原创 2011-08-11 15:02:04 · 88 阅读 · 0 评论 -
Grails - Logging from a Controller or Service
Logging informational messages from a controller or service is the sort of thing I wish I'd figured out how to do when I first started playing around with Grails. All the information is in the docs, b...原创 2011-08-11 14:55:16 · 99 阅读 · 0 评论 -
grails taglib修改datePicker格式
grails的datePicker标签很好,但是并不能设置成yyyy-MM-dd的格式,另外,在月份选择列表中,显示的是中文的:一月、二月等等,对于追求简捷的中国人来说,这不符合我们的习惯。怎么办? 在grails英文指南页面中,显示了它的源代码位置在:/grails/src/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormT...原创 2011-08-10 17:07:41 · 99 阅读 · 0 评论 -
grails使用build-test-data插件准备测试数据
什么?!还有专门负责测试数据准备的插件?至于么,这个任务应该太简单了!没错,从单个测试来讲,准备测试数据的确简单,但是如果你拥有大量测试用例的时候,事情就变得不那么简单了。前面忘了说一声,这里所指的测试数据专指Grails应用的领域类数据。 如果你给Grails应用写过单元测试,那么应该会对在测试前初始化领域类数据这一步骤不会感到陌生。刚开始,你可能会觉得,Grails实在是太好了,比起以前...原创 2011-08-10 11:30:49 · 86 阅读 · 0 评论 -
Grails, p6spy and Sql Profiler
There are several ways to have Grails log SQL statements that Hibernate is sending to the database under the covers of GORM. The first is the loggingSql flag in DataSource.groovy: [code="java"]log...原创 2011-08-09 23:05:32 · 104 阅读 · 0 评论 -
Fedora 14 下grails中文乱码问题(解决方法)
MySQL默认字符编码为latin1,因此用Grails写入数据时会导致乱码,修改方式为: /etc/init.d/mysql start (stop) 为启动和停止服务器 /etc/mysql/ 主要配置文件所在位置 my.cnf /var/lib/mysql/ 放置的是数据库表文件夹,这里的mysql相当于windows下mysql的date文件夹 启动mysql后,以root登录...原创 2011-10-20 18:25:49 · 98 阅读 · 0 评论 -
Register multiple date format for binding properities
Grails可以自动把params里面的参数绑定到domain class。有些时候为了能够绑定自定义的日期格式,例如"yyyy-MM-dd",需要register一个自己的CustomDateEditor。 有时候还有需求要绑定多种格式的日期,例如"yyyy/MM/dd"、"yyyy-MM-dd HH:mm:ss"等等,这时候就需要一个支持多种日期格式的CustomDateEditor,解...原创 2011-10-12 20:55:04 · 194 阅读 · 0 评论 -
Grails - binding a customized date format
It has been possible to bind a date directly since long before Grails 1.3. The steps are: (1) Create a class that registers an editor for your date format under grails-app/utils: [code="groovy"]...原创 2011-09-26 18:26:34 · 90 阅读 · 0 评论 -
Changing last login date in Grails with Spring Security
在使用grails spring security core plugin时,实现用户登录的时候更新上次登录时间 在Config.groovy添加如下代码: [code="groovy"]import com.myapp.User grails.plugins.springsecurity.useSecurityEventListener = true grails.plugi...原创 2011-09-06 14:31:29 · 133 阅读 · 0 评论 -
Grails, spring-security-core plugin:使用email登录
[b]1. Implement the first requirement – Add an email address property to the user domain[/b] This is really simple, just add the property to the domain class :) [code="groovy"]package org.custo...原创 2011-09-06 14:27:27 · 170 阅读 · 0 评论 -
Execute SQL Scripts in Grails Bootstrap or Integration Tests
I recently had to execute some SQL scripts when a Grails applications starts up to insert test data into the database. Executing sql scripts is easy. Just open the SQL File and read the contents of t...原创 2011-08-12 15:45:49 · 92 阅读 · 0 评论