grails

Uncaught ReferenceError: define is not defined

一曲冷凌霜 提交于 2020-01-14 04:10:29
问题 Thanks for any help you can offer. I have a Grails project that I'm trying to install Karma into. However, when I run ./gradlew build I get the following error: [x-10-105-56-234]SENG5199-twtr (BRANCH1) $ ./gradlew check :bowerInit UP-TO-DATE :nodeSetup UP-TO-DATE :bowerDependencies UP-TO-DATE :bowerConfig :bowerComponents UP-TO-DATE :bowerInstall UP-TO-DATE :compileJava UP-TO-DATE :compileGroovy UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :karmaInit UP-TO-DATE

Uncaught ReferenceError: define is not defined

烈酒焚心 提交于 2020-01-14 04:10:16
问题 Thanks for any help you can offer. I have a Grails project that I'm trying to install Karma into. However, when I run ./gradlew build I get the following error: [x-10-105-56-234]SENG5199-twtr (BRANCH1) $ ./gradlew check :bowerInit UP-TO-DATE :nodeSetup UP-TO-DATE :bowerDependencies UP-TO-DATE :bowerConfig :bowerComponents UP-TO-DATE :bowerInstall UP-TO-DATE :compileJava UP-TO-DATE :compileGroovy UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :karmaInit UP-TO-DATE

how to restrict action in grails shiro security

戏子无情 提交于 2020-01-14 03:12:29
问题 .please guide me that i have 2 methods in my Controller one is login and second is logout. and 1 role 'user' defined in my DB and i have a user with that role. now what i want to do is that person can login but could not access the logout button. how can i add permission/restrictions that would allow that user not to Logout. 回答1: Take a look at your other question (http://stackoverflow.com/questions/5815401/how-to-implement-shiro-security-of-grails-in-my-project) and use roleUser

How do you pass a JavaScript variable to your Groovy controller?

橙三吉。 提交于 2020-01-14 02:53:31
问题 I have been searching on Google for a really good while, and I cannot find a solution to this problem. I am trying to access a JavaScript variable from my GSP file in my Groovy controller, but I can't find out how to do this. Example: //JavaScript stuff <script> function validateForm(){ var ret = false } </script> //Groovy controller stuff def myAction = { println params.ret } How do I achieve something similar to this? 回答1: Two ways to pass a variable to the controller: Ajax Form submit Ajax

Generic method interception in grails (specifically Controllers)

。_饼干妹妹 提交于 2020-01-14 01:37:06
问题 I'm trying to create a generic function in grails that will allow me to specify a class and function name, and intercept any function calls based on that criteria: getSomeClass().metaClass.invokeMethod = { String methodName, args -> MetaMethod someAction = getSomeClass().metaClass.getMetaMethod(methodName, args) def result = someAction.invoke(delegate, args) if (methodName==getSomeMethodName()) intercept(args, result) return result } This works for POGO, and domain classes, but does not seem

How to access command objects from filter and is it possible at all?

[亡魂溺海] 提交于 2020-01-13 19:11:36
问题 I often write something like: def myAction{ MyActionCommand cmd -> if( cmd.hasErrors() ){ return render(status:HttpServletResponse.SC_BAD_REQUEST ); }else{ // actual action logic } So, I'd like to extract that common pattern into some reusable location. Filter looks like good candidate, but I can't find the way to get command object from the filter. Tryed something like this (in filters closure): formValidation( controller:'*', action:'*' ){ before = { cmd -> if( cmd.hasErrors() ){ response

How to access command objects from filter and is it possible at all?

纵然是瞬间 提交于 2020-01-13 19:11:11
问题 I often write something like: def myAction{ MyActionCommand cmd -> if( cmd.hasErrors() ){ return render(status:HttpServletResponse.SC_BAD_REQUEST ); }else{ // actual action logic } So, I'd like to extract that common pattern into some reusable location. Filter looks like good candidate, but I can't find the way to get command object from the filter. Tryed something like this (in filters closure): formValidation( controller:'*', action:'*' ){ before = { cmd -> if( cmd.hasErrors() ){ response

How to access command objects from filter and is it possible at all?

不羁的心 提交于 2020-01-13 19:11:06
问题 I often write something like: def myAction{ MyActionCommand cmd -> if( cmd.hasErrors() ){ return render(status:HttpServletResponse.SC_BAD_REQUEST ); }else{ // actual action logic } So, I'd like to extract that common pattern into some reusable location. Filter looks like good candidate, but I can't find the way to get command object from the filter. Tryed something like this (in filters closure): formValidation( controller:'*', action:'*' ){ before = { cmd -> if( cmd.hasErrors() ){ response

Grails 2.1.0 app tomcat 7.0.22 Session empty after redirect

馋奶兔 提交于 2020-01-13 16:25:27
问题 I am just learning grails and have a problem with an app that works fine when I run it in Netbeans but shows strange behavior when deployed to Tomcat 7.0.22 on a Centos 5.4 server. I am using the proxy_ajp to make the app available with apache. The problem seems to be with the session not being maintained after a redirect so that I lose the login information causing the app to try to login again. My proxy_ajp settings are <Location /PreyerBooks > ProxyPass ajp://localhost:8011/PreyerBooks

Error deploying Grails application - Beginner

纵然是瞬间 提交于 2020-01-13 12:05:14
问题 I am having issues deploying a Grails application. Everything works in the local test environment. ERROR [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean