- 浏览: 235954 次
- 性别:
- 来自: 宁波
最新评论
-
wilesun:
很垃圾
用dojo的tree widget时处理json乱码 -
hellofuck:
有没有办法获得一组名字和id不同的一组checkbox呢?
转帖:获得一组checkbox的值 -
livingbody:
能否传一个list数据集合给报表?
从BIRT报表文件中获取其使用数据源的数据库连接信息 -
kunyu0000:
那位大虾说一下,你们有没有尝试过这个例子,我试过不行,调用以上 ...
在DWR中实现直接获取一个JAVA类的返回值的两种方法 -
volking:
...
设置正确的Content-Type以解决Ext的中文乱码问题
文章列表
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 ...
- 2008-10-02 09:13
- 浏览 2752
- 评论(0)
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 ...
- 2008-09-09 11:05
- 浏览 1106
- 评论(0)
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', ...
- 2008-07-11 08:42
- 浏览 1227
- 评论(0)
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 ...
- 2008-06-24 11:51
- 浏览 1261
- 评论(0)
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 ...
- 2008-06-15 09:37
- 浏览 1336
- 评论(0)
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. ...
- 2008-06-14 22:02
- 浏览 1301
- 评论(0)
默认自动建立名称为HIBERNATE_SEQUENCE的sequence,可以在domain里用以下方法指定:
static mapping = {
id generator: 'sequence', params: [sequence: 'seq_name']
}
- 2008-06-14 20:18
- 浏览 2049
- 评论(0)
import org.codehaus.groovy.grails.commons.ApplicationAttributes
def ctx =
servletContext.getAttribute(ApplicationAttributes.APPLICATION_CONTEXT)
http://www.nabble.com/Bootstrap-and-applicationContext-td16302106.html#a16302106
- 2008-06-14 20:00
- 浏览 1444
- 评论(0)
将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
- 2008-06-12 17:11
- 浏览 3336
- 评论(0)
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 ...
- 2008-06-10 11:50
- 浏览 1332
- 评论(0)
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 ...
- 2008-06-08 10:20
- 浏览 1765
- 评论(0)
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 ...
- 2008-05-26 10:56
- 浏览 1638
- 评论(0)
1、Using XML
<bean id="sqlService" class="SqlService">
<property name="dataSourceMap">
<map>
<entry key="a">
<ref bean="dataSourceA"/>
</entry>
<entry key="b" ...
- 2008-05-26 10:33
- 浏览 1438
- 评论(0)
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& ...
- 2008-05-22 17:38
- 浏览 1687
- 评论(0)
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. ...
- 2008-02-18 23:15
- 浏览 3212
- 评论(0)