Search Results

Search found 4868 results on 195 pages for 'grails validation'.

Page 12/195 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • security roles in grails portlets

    - by srinath
    Hi, How to include security roles in grails portlets for liferay ? After deploying war in tomcat i added manually these lines for roles liferay-portlet.xml : <role-mapper> <role-name>administrator</role-name> <role-link>Administrator</role-link> </role-mapper> portlet.xml : <security-role-ref> <role-name>administrator</role-name> </security-role-ref> But How to add these roles settings in grails app before creating war ?? Please suggest me . thanks in advance sri..

    Read the article

  • Grails Illegel Exception

    - by Srinath
    Hi, Can any one tell me when this error occurs . I suspect this is coming when added any new js in Grails . I'm unable to dig this : 16 Apr, 2010 4:58:25 PM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load org.codehaus.groovy.grails.plugins.codecs.HTMLCodecBeanInfo. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException thanks in advance, srinath

    Read the article

  • ImageMagick and Grails not working

    - by TripWired
    I'm trying to have ImageMagick run from grails to convert some images when I run the command to make an image nothing happens. I get no errors, no information returned nothing at all. I've tried running other commands like touch and ps ux just to see if they work and they all work fine. It just seems like the imagemagick commands are getting lost and I''m not sure what to do. Here is the code I've been working with. String command = CH.config.ImageMagickPath + "/convert -size 40x20 xc:red xc:blue -append -rotate 90 append_rotate.gif" println command command.execute() CH.config.ImageMagickPath is set up to where imagemagick/bin is. I've taken what is shown in println command and run it in a terminal and it works fine. Is there any reason why I can't get IM to work from grails?

    Read the article

  • Querying and ordering results of a database in grails using transient fields

    - by Azder
    I'm trying to display paged data out of a grails domain object. For example: I have a domain object Employee with the properties firstName and lastName which are transient, and when invoking their setter/getter methods they encrypt/decrypt the data. The data is saved in the database in encrypted binary format, thus not sortable by those fields. And yet again, not sortable by transient ones either, as noted in: http://www.grails.org/GSP+Tag+-+sortableColumn . So now I'm trying to find a way to use the transients in a way similar to: Employee.withCriteria( max: 10, offset: 30 ){ order 'lastName', 'asc' order 'firstName', 'asc' } The class is: class Employee { byte[] encryptedFirstName byte[] encryptedLastName static transients = [ 'firstName', 'lastName' ] String getFirstName(){ decrypt("encryptedFirstName") } void setFirstName(String item){ encrypt("encryptedFirstName",item) } String getLastName(){ decrypt("encryptedLastName") } void setLastName(String item){ encrypt("encryptedLastName",item) } }

    Read the article

  • Grails/Spring HttpServletRequest synchronization

    - by Jeff Storey
    I was writing a simple Grails app and I have a spot in a gsp where one of my java beans in modified. <g:each in="${myList}" status="i" var="myVar"> // if the user performs some view action, update one of the myVar elements </g:each> This works, but I don't think it's quite threadsafe. myList is an http request variable but in cases of pages that use ajax (or other client side manipulations), it is possible for two threads to be modifying the same request scope variable The Spring AbstractController class provides a setSynchronizeOnSession method. Does grails provide any equivalent functionality? If not, what's the best way to protect this non-threadsafe mutation? thanks, Jeff

    Read the article

  • Best way to model map values in Grails?

    - by Mulone
    Hi guys, I have to implement map values in my Grails app. I have a class that can contain 0..N OsmTags, and the key is unique. In Java I would model this with a Map in each object, but I don't know how to map classes in Grails. So I defined this class: class OsmTag { /** OSM tag name, e.g. natural */ String key /** OSM tag value, e.g. park */ String value static constraints = { key blank:false, size:2..80,matches:/[\S]+/, unique:false value blank:false, size:1..250,matches:/[\S]+/, unique:false } } That works ok, but it's actually quite ugly because the tag key is not unique. Is there a better way to model this issue? Cheers

    Read the article

  • grails date from params in controller

    - by nils petersohn
    y is it so hard to extract the date from the view via the params in a grails controller? i don't want to extract the date by hand like this: instance.dateX = parseDate(params["dateX_value"])//parseDate is from my helper class i just want to use instance.properties = params you know :) in the model the type is java.util.Date and in the params is all the information (dateX_month, dateX_day, ...) i searched on the net and found nothing on this :( i hoped that grails 1.3.0 could help but still the same thing. i can't and will not belief that extracting the date by hand is nessesary!

    Read the article

  • How to make if loop in grails?

    - by user3569696
    I'm beginner in Grails, please help. I have this in my gsp <div class="right66"> <g:select class="time_pick" name="pick_day" placeholder="" from="${['Dani', 'Sati', 'Minute']}" valueMessagePrefix="book.category"/> </div> In translation: Dani=Days, Sati= Hours, Minute= Minutes. I need to save data in minutes but User have privilege to choose will his input be in minutes, days or hours. So i have to do if loop. I now how if loop works but i don't know how to wite it in grails. I was thinking something like this: n=1 if(params.type=Dani){ n= 3600 }else if(params.type=Sati) { n=60 } def minute=params.minute*n but how to call that choosen input "Dani"? I can't write Params.type=Dani. Does if loop go in controller in my case?

    Read the article

  • Grails: Querying Associations causes groovy.lang.MissingMethodException

    - by Paul
    Hi, I've got an issue with Grails where I have a test app with: class Artist { static constraints = { name() } static hasMany = [albums:Album] String name } class Album { static constraints = { name() } static hasMany = [ tracks : Track ] static belongsTo = [artist: Artist] String name } class Track { static constraints = { name() lyrics(nullable: true) } Lyrics lyrics static belongsTo = [album: Album] String name } The following query (and a more advanced, nested association query) works in the Grails Console but fails with a groovy.lang.MissingMethodException when running the app with 'run-app': def albumCriteria = tunehub.Album.createCriteria() def albumResults = albumCriteria.list { like("name", receivedAlbum) artist { like("name", receivedArtist) } // Fails here maxResults(1) } Stacktrace: groovy.lang.MissingMethodException: No signature of method: java.lang.String.call() is applicable for argument types: (tunehub.LyricsService$_getLyrics_closure1_closure2) values: [tunehub.LyricsService$_getLyrics_closure1_closure2@604106] Possible solutions: wait(), any(), wait(long), each(groovy.lang.Closure), any(groovy.lang.Closure), trim() at tunehub.LyricsService$_getLyrics_closure1.doCall(LyricsService.groovy:61) at tunehub.LyricsService$_getLyrics_closure1.doCall(LyricsService.groovy) (...truncated...) Any pointers?

    Read the article

  • Dynamic domain methods missing from grails service when injected into java service in grails app.

    - by Gordon C
    I had the idea that I would write my GroovyDao as a grails service. Next I would write a MyJavaService in java and locate it in the java sources dir in my grails app. MyJavaService contains a instance reference to groovyDao for spring injection. I would wire up in resources.groovy the MyJavaService with a groovyDao = ref("GroovyDao"). Everything starts up fine. However if I make call to MyJavaService any Domain method like Domain.list() returns a Method not found error. Any help is appreciated.

    Read the article

  • How to do concurrent modification testing for grails application

    - by werner5471
    I'd like to run tests that simulate users modifying certain data at the same time for a grails application. Are there any plug-ins / tools / mechanisms I can use to do this efficiently? They don't have to be grails specific. It should be possible to fire multiple actions in parallel. I'd prefer to run the tests on functional level (so far I'm using Selenium for other tests) to see the results from the user perspective. Of course this can be done in addition to integration testing if you'd recommend to run concurrent modification tests on integration level as well.

    Read the article

  • Sharing session (or cookie) using Grails acegi plugin

    - by firnnauriel
    Is it possible for two different Grails project, also having different domains, to share a session/cookie? Let's say I have 2 sites: www.mycompany.com, and, www.othercompany.com. Assume that both sites are having same domains, and same database and records too. What I want to know is if this code: authenticateService.userDomain() or even the authenticateService.isLoggedIn() will behave and return exactly the same object/result whether it is called in either of the site. Basically, what we need is a solution for sharing/identifying logged in user between two different sites. Need more details on how to implement this using acegi 0.5.2 and grails 1.2.1. Hoping for any leads on this. Thank you.

    Read the article

  • Grails remoteLink handling error codes

    - by soybie
    I'm on grails 1.3.6 and I see the following behavior. <g:javascript library="prototype" /> ... <g:remoteLink action="punch" id="${personInstance.id}" update="damage_${personInstance.id}" on401="alert('foo!');"> generates: <a on401="alert('foo!');" onclick="new Ajax.Updater('damage_5','/blah/person/punch/5',{asynchronous:true,evalScripts:true});return false;" href="/blah/person/punch/5"></a> "on401" isn't a supported event attribute for an anchor tag, so is this a bug in grails?

    Read the article

  • wrong data type in mysql for grails byte[] property

    - by srkiNZ84
    Hi, I have an application which is trying to save a photo to the database. I've created a grails domain class with a byte[] property and this was working well when using HSQLDB (the default in grails). However, when I changed the database to MySQL I ended up getting the following error: Data truncation: Data too long for column 'photo' at row 1 I then had a look at the schema and found that the byte[] was being created as a TINYBLOB field, which was causing the error. How can I specify that this property should correspond to a BLOB/LONGBLOB type in the database?

    Read the article

  • Weird NodeBuilder and GPath behaviour in Grails

    - by yogiebiz
    Hi, I am quite new with Grails and now I have a problem while using NodeBuilder and GPath. Here is the code snippet def builder = new NodeBuilder() def menu = builder.menu { header(title: "header 1") { submenu(title: "submenu 1.1") submenu(title: "submenu 1.2") } header(title: "header 2") } menu.grep { println it.'@title' When I executed it with Groovy 1.7.2, the result was: header 1 header 2 which just like I expected. But when I executed the code in Grails 1.3.1, the result was different. The result was: submenu 1.1 submenu 1.2 any idea why this happened?

    Read the article

  • Grails - showing page processing/render debug information in development mode

    - by ovokinder
    I've been experimenting with Grails for the past two days and, so far, I'm really happy with it. Coming from Rails, the only thing I've really been missing here is the dev-mode debug information shown after the page has been served. This is what I mean: Processing UsersController#show (for 127.0.0.1 at 2010-06-14 10:28:44) [GET] Parameters: {"id"=>"2"} User Load (0.0ms) SELECT * FROM "users" WHERE ("users"."id" = 2) Rendering template within layouts/users Rendering users/show Completed in 24ms (View: 5, DB: 0) | 200 OK [http://localhost/users/2] Is there any way to get something similar in Grails? I've tried the "debug" plugin but its not very useful as it only shows the total processing time. I know it's not hard too roll something of my own (except for that database stats part), I just wanted to make sure I wasn't unnecessarily reinventing the wheel.

    Read the article

  • asp.net mvc client side validation; manually calling validation via javascript for ajax posts

    - by Jopache
    Under the built in client side validation (Microsoft mvc validation in mvc 2) using data annotations, when you try to submit a form and the fields are invalid, you will get the red validation summary next to the fields and the form will not post. However, I am using jquery form plugin to intercept the submit action on that form and doing the post via ajax. This is causing it to ignore validation; the red text shows up; but the form posts anyways. Is there an easy way to manually call the validation via javascript when I'm submitting the form? I am still kind of a javascript n00b. I tried googling it with no results and looking through the js source code makes my head hurt trying to figure it out. Or would you all recommend that I look in to some other validation framework? I liked the idea of jquery validate; but would like to define my validation requirements only in my viewmodel. Any experiences with xval or anything of the sort?

    Read the article

  • It is possible to override a plugin's Controller from another plugin?

    - by fabschu
    I'm developing a plugin (MyPlugin) which combines some security functions to use it as a standard plugin for my next Grails application. It integrates the Spring-Security-Core and Spring-Security-UI plugins, and by its installation all dependencies should be installed automatically by adding the dependencies in the BuildConfig like: plugins { compile: ...} So far everything works fine, but in MyPlugin I'm changing the behaviour of the Spring-Security-UI plugin (password encoding in User Domain), by overwriting the UserController. Executing MyPlugin leads to the expected behaviour and new Users are created using the correct Controller. However, when installing MyPlugin in another Grails application, this behaviour fails and the original UserController of the Spring-Security-Ui plugin is used. I tried to solve this by configuring the dependsOn and loadAfter properties in the GrailsPlugin file, but without any success. Is it possible to fix this? Or is it only possible to overwrite behaviour/controllers in the main application?

    Read the article

  • Is it practical to have perfect validation score on HTML?

    - by Truth
    I was in a heated discussion the other day, about whether or not it's practical to have a perfect validation score on any HTML document. By practical I mean: Does not take a ridiculous amount of time compared to it's almost-perfect counterpart. Can be made to look good on older browsers and to be usable on very old browsers. Justifies the effort it may take to do so (does it come with some kind of reward on SEO/Usability/Accessibility that cannot be achieved in a simpler way with almost-perfect validation) So basically, is perfect validation score practical on any HTML document?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >