100%拿来主义——基于EasyUI和Grails的应用"框架"?!

博主分享了使用Grails 1.3.4进行首个WEB应用开发的经历,包括采用Acegi实现权限管理及JQueryEasyUI进行界面布局的具体实践,并记录了开发过程中遇到的问题及其解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

国庆节的一半走在折腾这个应用,由于是个人的第一个WEB开发,所以走了不少弯路 :-) 废话不说了,上图:


[img]http://dl.iteye.com/upload/attachment/326084/6f078ed5-4d39-3bf0-958b-a19be57f397e.png[/img]

[img]http://dl.iteye.com/upload/attachment/326080/123b4495-033c-3468-bdc5-59cd73624b96.png[/img]

开发环境:

[list]
[*] Grails 1.3.4
[*] Acegi 0.5.3
[*] class-diagram 0.5.2
[/list]

实现功能:

[list]
[*] 基于Acegi的权限管理框架
[*] 基于JQuery EasyUI 1.2的Tab布局
[/list]

遇到的几个问题和收获:

1) 如何通过iframe新建TAB页


<a href="javascript:void(0)" class="easyui-linkbutton" plain="true" iconCls="icon-cancel" onclick="addTab('用户管理', '/matrix/user/list');">用户管理</a><br>

这里的这个链接:"/matrix/user/list"花了我好长的时间,才知道在DEBUG环境下需要添加一个"/matrix"


function addTab(title, url){
if ($('#tt').tabs('exists', title)){
$('#tt').tabs('select', title);
} else {
var content = '<iframe scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:100%;"></iframe>';
$('#tt').tabs('add',{
title:title,
content:content,
closable:true
});
}
}


2) 权限系统初始化:


class BootStrap {

def authenticateService = new AuthenticateService()

def init = { servletContext ->
new Role(authority: 'ROLE_ADMIN_USER', description: '系统管理员').save()
new Role(authority: 'ROLE_USER', description: '普通用户').save()

println "系统角色:"
println Role.findAll()

def user = new User(
username: 'administrator',
passwd: authenticateService.passwordEncoder("123456"),
enabled:true,
email:"bruce.lin.chn@gmail.com",
userRealName:"热带翎羽",
mobile:"18900000000",
telephone:"0592100000"
)

user.addToAuthorities(Role.findByAuthority("ROLE_ADMIN_USER"))
user.save()

user = new User(
username: 'bruce',
passwd: authenticateService.passwordEncoder("123456"),
enabled:true,
email:"bruce.lin.chn@gmail.com",
userRealName:"热带翎羽",
mobile:"18900000000",
telephone:"0592100000"
)

user.addToAuthorities(Role.findByAuthority("ROLE_USER"))
user.save()

println "系统预置用户:"
println User.findAll()

new RequestMap(url:"/user/*", configAttribute:"ROLE_ADMIN_USER").save()
new RequestMap(url:"/role/*", configAttribute:"ROLE_ADMIN_USER").save()
new RequestMap(url:"/requestmap/*", configAttribute:"ROLE_ADMIN_USER").save()

println "权限映射:"
println RequestMap.findAll()
}
def destroy = {
}
}


未解决的问题:

FORM的整体表现太“雷”人了,不知道如何优化一下,比如说:排版... 图标和圆角修饰
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值