grails真太好了

purpen 2009-05-12

用了一段时间了,太好用了。

一些发布命令

grailsdevwar打包dev

grailsprodwar打包prod

grailsprodrun-war

grailsprodrun-app

外部数据源配置

datasource.groovy把数据源写死了,会编译成class的,到现场实施的时候,用ultraedit修改class文件,还得保持字符串长度不变,郁闷死了

网上介绍的方法如下,根本就没有试验成功:

conf文件夹:ds.properties

production里面:

defproperties=PropertiesLoaderUtils.loadProperties(newClassPathResource("ds.properties"))

url=properties.getProperty("url")

driverClassName=properties.getProperty("driverClassName")

dialect=properties.getProperty("dialect")

username=properties.getProperty("username")

password=properties.getProperty("password")

dbCreate="update"

pooled=true

没成功,我用tomcatserver.xml中的jndi数据源了

fckeditor的使用:

http://www.grails.org/plugin/fckeditor

grailsinstall-pluginxxx.zip(运行错,可用IDEA的功能)

config.groovy:

fckeditor{

upload{

basedir="/tmp/storagearea/"

baseurl="/uploads/"

overwrite=false

link{

browser=true

upload=false

allowed=[]

denied=['html','htm','php','php2','php3','php4','php5',

'phtml','pwml','inc','asp','aspx','ascx','jsp',

'cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg',

'cgi','htaccess','asis','sh','shtml','shtm','phtm']

}

image{

browser=true

upload=true

allowed=['jpg','gif','jpeg','png']

denied=[]

}

flash{

browser=false

upload=false

allowed=['swf']

denied=[]

}

media{

browser=false

upload=false

allowed=['mpg','mpeg','avi','wmv','asf','mov']

denied=[]

}

}

}

页面:

<fckeditor:editorname="newsContent"width="100%"height="400"toolbar="Standard"fileBrowser="default">

${fieldValue(bean:newsInstance,field:'newsContent').decodeHTML()}</fckeditor:editor>

另外,特别违反常规思维的是:each是不能用return终止的

相关推荐