`
boogie
  • 浏览: 235993 次
  • 性别: Icon_minigender_1
  • 来自: 宁波
社区版块
存档分类
最新评论
文章列表
Accessing the contentWindow property to obtain the location object. $('#iframe').each(function() { this.contentWindow.location.reload(true); }); Callback for IFrame Loading With the onload event, your code is called when an IFrame has finished loading. $('#iframe').load(function() { // do s ...
1、sites.xml <?xml version="1.0" encoding="ISO-8859-1"?> <sites> <site id="0"> <title>Think2Loud</title> <url>http://www.think2loud.com</url> <desc> <brief>this is the brief description.</brief ...
def props = new Properties() InputStream is = new BufferedInputStream(new FileInputStream("${System.getenv("SITEHOME")}/config/cms.properties")) props.load(is) is.close() environments { test { dataSource { dbCreate = "create" // one of 'create', ...
The internal if/else tags that come with Grails translate directly into if(..) {} else {} at the syntax level to improve performance of such core tags . But you can quite easily write if/else tags using the pageScope object and Grails' standard tags for example: def ifSomething = { att ...
1、MyClass with a static method class MyClass { static processList(list) { // does something } }   2、Calling static method processList doProcessList(String className, list) { MetaClass mc = GroovySystem.metaCla ...
import org.codehaus.groovy.grails.commons.ApplicationHolder class BootStrap {     def init = {servletContext ->         ApplicationHolder.application.domainClasses.each() {             println it.fullName // full name with package             println it.name // simple class name             it. ...
默认自动建立名称为HIBERNATE_SEQUENCE的sequence,可以在domain里用以下方法指定:       static mapping = {         id generator: 'sequence', params: [sequence: 'seq_name']     }
import org.codehaus.groovy.grails.commons.ApplicationAttributes def ctx = servletContext.getAttribute(ApplicationAttributes.APPLICATION_CONTEXT)   http://www.nabble.com/Bootstrap-and-applicationContext-td16302106.html#a16302106
将param替换成paramValue   def queryContent = "select * from query where id=${param}" def regex = '\\$\\{param\\}' def matcher = (queryContent =~ /${regex}/) queryContent = matcher.replaceAll('paramValue')   参考: http://docs.codehaus.org/display/GROOVY/Tutorial+5+-+Capturing+regex+groups  
I have class named User and another one named Role and they are related to each other in a many-to-many way, a user has many roles and in a role there are many users Besides the user and role tables I get another table named role_user which has only two fields: roles_id and users_id roles ...
1、sql.rows returns a List of g.sql.GroovyRowResult which implements Map def results = [] sql.rows(queryString, args).each {Map row -> println "row.dump():${row.dump()}" results << row }  2、sql. eachRow iterates providing a g.sql.GroovyResultSet ...
The main advantage of using the Spring DSL is that you can now mix logic in within your bean definitions, for example based on the environment : import grails.util.* beans { switch(GrailsUtil.environment) { case "production": myBean(my.company.MyBeanImpl) { bookService = ref(&quo ...
1、Using XML <bean id="sqlService" class="SqlService"> <property name="dataSourceMap"> <map> <entry key="a"> <ref bean="dataSourceA"/> </entry> <entry key="b" ...
1、How do I configure a bean like this using Spring DSL ? <bean id="mailSession" class="javax.mail.Session" factory-method="getInstance"> <constructor-arg> <props> <prop key="mail.smtp.auth">true& ...
https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/134537 出错原因:Eclipse 3.2 requires ant 1.6. However, gutsy only includes ant 1.7 解决方法如下: cd /tmp mkdir ant cd ant unzip /usr/share/java/ant-launcher.jar unzip /usr/share/java/ant.jar jar cf ../ant.jar * sudo rm /usr/lib/eclipse/plugins/org.apache. ...
Global site tag (gtag.js) - Google Analytics