自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 Linux MySQL主从复制(Replication)配置

MySQL是开源的关系型数据库系统。复制(Replication)是从一台MySQL数据库服务器(主服务器master)复制数据到另一个服务器(从服务器slave)的一个进程。 配置主服务器(master) 1、编辑数据库配置文件my.cnf,一般在/etc/目录下。 #vi /etc/my.cnf 在[mysqld]的下面加入下面代码: log-bin=mysql-bi...

2012-10-23 13:54:57 112

原创 Fedora 14: Install Apache log analizer, AWstats.

[b][1] Install AWstats[/b] [color=blue] [root@www03 ~]#yum -y install awstats[/color] [color=blue][root@www03 ~]#vi /etc/awstats/awstats.www03.server.world.conf # this file is already locate (r...

2012-01-13 16:44:19 176

原创 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 95

原创 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 184

原创 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 89

原创 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 128

原创 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 162

原创 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 87

原创 Fedora 14下subversion开机自动启动配置

在Fedora 14了安装了subversion,不想直接简单的写到启动脚本里启动,于是google到下面的脚本了,毕竟用chkconfig和service命令更方便。 本脚本能让subversion作为一个守护进程启动。 vi /etc/init.d/subversion [code="shell"] #!/bin/bash # # /etc/rc.d/init.d/su...

2011-08-21 18:36:35 183

原创 Apache2使用 .htaccess控制访问权限

这里涉及的配置方式主要是使用 .htaccess 文件, 要使用.htaccess文件,则必须设置服务器以允许在这些文件中使用认证指令,即用AllowOverride指令指定哪些指令在针对单个目录的配置文件中有效。首先将对应的AllowOverride这样设置: AllowOverride All 首先,应该创建一个用于认证的密码文件,并且这个文件不应该置于DocumentR...

2011-08-17 18:28:01 567

原创 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 86

原创 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 83

原创 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 95

原创 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 97

原创 Hibernate的锁机制

[b]1.悲观锁[/b] 它指的是对数据被外界修改持保守态度。假定任何时刻存取数据时,都可能有另一个客户也正在存取同一笔数据,为了保持数据被操作的一致性,于是对数据采取了数据库层次的锁定状态,依靠数据库提供的锁机制来实现。 基于jdbc实现的数据库加锁如下: [code="sql"]select * from account where name="Erica" for update...

2011-08-10 14:02:44 71

原创 grails使用build-test-data插件准备测试数据

什么?!还有专门负责测试数据准备的插件?至于么,这个任务应该太简单了!没错,从单个测试来讲,准备测试数据的确简单,但是如果你拥有大量测试用例的时候,事情就变得不那么简单了。前面忘了说一声,这里所指的测试数据专指Grails应用的领域类数据。 如果你给Grails应用写过单元测试,那么应该会对在测试前初始化领域类数据这一步骤不会感到陌生。刚开始,你可能会觉得,Grails实在是太好了,比起以前...

2011-08-10 11:30:49 84

原创 Fedora 15 配置redmine+passenger+apache遇到的问题

按照官方说明文档配置以后,访问http://localhost/redmine 1. 遇到Permission denied: access to /redmin denied的问题,后来发现是SELinux的问题,由于不是很懂怎么设置passenger文件的context设置,只能采取比较低级的解决方法。 setenforce 0 设置SELinux为permissive 2. ...

2011-08-09 23:29:24 98

原创 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 102

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除