使用Grails/BlazeDS/Flex開發(fā)步驟
使用Grails + BlazeDS + Flex開發(fā)過程
- grails 1.2.2 安裝blazeds插件
grails install-plugin blazeds
這個插件因為依賴于acegi,所以也會同時安裝acegi
- 執(zhí)行安裝acegi后的命令 grails create-auth-domains,否則測試的echoservice無法使用
- 然后就可以構建自己的service
具體可以參照
http://sebastien-arbogast.com/2010/05/14/grailsblazedsflexiphone-full-stack-part-23/
1)關于權限部分:
可以直接在service的方法上使用 @Secured("ROLE_PROJECT_ADMIN") 類似,如果有service的方法加了標記,只有等用戶登錄之后,并且屬于這個role,才可以執(zhí)行
2)關于用戶登錄
可以直接使用channelset的login來執(zhí)行
protected function loginButton_clickHandler(event:MouseEvent):void
{
channelSet.login(username.text, password.text);
}
protected function logoutButton_clickHandler(event:MouseEvent):void
{
channelSet.logout();
}
{
channelSet.login(username.text, password.text);
}
protected function logoutButton_clickHandler(event:MouseEvent):void
{
channelSet.logout();
}
posted on 2012-02-14 17:05 想飛就飛 閱讀(329) 評論(0) 編輯 收藏 所屬分類: Groovy/Grails