我在2个控制器中注入spring security,如下所示:
class ClassName{
def springSecurityService
Run Code Online (Sandbox Code Playgroud)
在某些方法中我做:
def user = springSecurityService.getCurrentUser() as Employee
Run Code Online (Sandbox Code Playgroud)
在一个控制器中,springSecurityService工作并返回当前用户,但在另一个控制器中,我得到以下异常:
groovy.lang.MissingPropertyException: No such property: springSecurityService for class: DUMMY
Run Code Online (Sandbox Code Playgroud)
我可能做错了什么?
编辑:
控制器:
这是好的一部分:
class EmployeeController {
def employeeService
def springSecurityService
def me() {
def emp = springSecurityService.getCurrentUser() as Employee
def toRet = [
id: emp.id,
firstName: emp.firstName,
lastName: emp.lastName,
username: emp.username,
budget: employeeService.getUserBudget(emp)
]
render toRet as JSON
}
}
Run Code Online (Sandbox Code Playgroud)
这是有问题的控制器的一部分:
class GroupController {
def groupService
def messageSource
def springSecurityService
def list = {
def user = …Run Code Online (Sandbox Code Playgroud) 在Chrome版本47中,它们强制您使用https来允许使用getUserMedia().不幸的是,我无法在我的整个网络中使用https,我只在登录休息时使用它(它是SPA - 单页应用程序).因此,Web的地址没有https,只有登录休息使用ssl.我使用这个repo只有很少的变化:https: //github.com/Jmlevick/html-recorder
我的问题是,有没有办法在我的网络应用程序中使用录音机,并保持我的网址与http而不是https?你有什么想法来克服这个问题?
我有两个指令:
// Generated by CoffeeScript 1.6.3
app.directive("focusMe", function() {
return {
scope: {
focus: "=focusMe"
},
link: function(scope, element) {
return scope.$watch("focus", function(value) {
if (value === true) {
element[0].focus();
return scope.focus = false;
}
});
}
};
});
Run Code Online (Sandbox Code Playgroud)
和:
// Generated by CoffeeScript 1.6.3
app.directive("cleanMe", function() {
return {
scope: {
clean: "=cleanMe"
},
link: function(scope, element) {
return scope.$watch("clean", function(value) {
if (value === true) {
element[0].value = "";
return scope.clean = false;
}
});
}
};
}); …Run Code Online (Sandbox Code Playgroud) 我正在尝试这样做:
"/templates/$tml"{
view: "/templates/$tml"
}
Run Code Online (Sandbox Code Playgroud)
还有这个:
"/templates/$tml"{
view: "/templates/${tml}"
}
Run Code Online (Sandbox Code Playgroud)
还有这个:
"/templates/$tml"{
view: "/templates/${params.tml}"
}
Run Code Online (Sandbox Code Playgroud)
但它们都不起作用.在模板文件夹中,我有很多GSP文件,我不想逐个映射它们,而是我想要一些通用代码,它们像控制器映射一样映射它们.
感谢帮助!
我只需要.min文件,但它会下载整个repo并且它非常大.
这是我的bower.json
{
"name": "blah",
"version": "0.0.0",
"dependencies": {
"backbone": "~1.0.0",
"underscore": "~1.4.4",
"jquery": "~1.9.1",
"backbone.localStorage": "~1.1.0",
"bootstrap": "",
"requirejs": "",
"mustache": "",
"hammerjs": ""
}
}
Run Code Online (Sandbox Code Playgroud) javascript ×3
grails ×2
angularjs ×1
bower ×1
getusermedia ×1
gsp ×1
spring ×1
url-mapping ×1
yeoman ×1