1.默認的webserver是tomcat.
如果想切換為jetty。grails uninstall-plugin tomcat
grails install-plugin jetty
2. 有了很多標準的規(guī)范,比如 :
1). <meta name="layout" content="indexlayout" /> 必須放入<header/>標簽之內。
2).urlmap中 "/test_$guid?"(controller:"test",action:"list")
"/" (controller:"index",action:"list")
root map將不會生效.
設置"/test_$guid"(controller:"test",action:"list")
"/" (controller:"index",action:"list")
root map將會生效.
等等
3. hibernate cache
在linux中如果在DataSource.groovy中設置:
hibernate {
cache.use_second_level_cache=true
cache.use_query_cache=true
cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}
不同的用戶啟動grails app將會出現(xiàn)/tmp/***無權限問題
因為這里將采用默認的ehcache設置
解決的辦法之一:在grails-ap/conf中加入ehcache.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect">
<diskStore path="java.io.tmpdir"/>
<cacheManagerEventListenerFactory class="" properties=""/>
<defaultCache maxElementsInMemory="10000" eternal="false" timeToLiveSeconds="120" overflowToDisk="false" diskPersistent="false"/>
<cache name="sampleCache1" maxElementsInMemory="10000" timeToIdleSeconds="300" />
<cache name="org.hibernate.cache.UpdateTimestampsCache" maxElementsInMemory="10000" timeToIdleSeconds="300" />
<cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="10000" timeToIdleSeconds="300" />
</ehcache>
具體的參數(shù)可以設置.<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect">
<diskStore path="java.io.tmpdir"/>
<cacheManagerEventListenerFactory class="" properties=""/>
<defaultCache maxElementsInMemory="10000" eternal="false" timeToLiveSeconds="120" overflowToDisk="false" diskPersistent="false"/>
<cache name="sampleCache1" maxElementsInMemory="10000" timeToIdleSeconds="300" />
<cache name="org.hibernate.cache.UpdateTimestampsCache" maxElementsInMemory="10000" timeToIdleSeconds="300" />
<cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="10000" timeToIdleSeconds="300" />
</ehcache>
4. 其他
后續(xù)....