Search Results

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

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

  • grails scaffolding broken

    - by damian
    Grails scaffoldin does not work in my grails application. When I go from the main page to the specific controller page it output something like this: Error 500: Servlet: default URI: /myapp/myDomain/list Exception Message: Tag [sortableColumn] is missing required attribute [title] or [titleKey] at /webTestDummyDomain/list:25 Caused by: Error processing GroovyPageView: Tag [sortableColumn] is missing required attribute [title] or [titleKey] at /myDomain/list:25 Class: /myDomain/list At Line: [25] Code Snippet: Code snippet empty. If I try to create a new app scaffold works perfectly. Additional data: Application Status * App version: 0.1 * Grails version: 1.2.2 * JVM version: 1.6.0_20 * Controllers: 11 * Domains: 10 * Services: 19 * Tag Libraries: 26 Installed Plugins * i18n - 1.2.2 * filters - 1.2.2 * logging - 1.2.2 * core - 1.2.2 * tomcat - 1.2.2 * webtest - 2.0.4 * functionalTest - 1.2.7 * yui - 2.7.0.1 * rest - 0.3 * jquery - 1.4.2.1 * bubbling - 2.1.2 * urlMappings - 1.2.2 * groovyPages - 1.2.2 * servlets - 1.2.2 * dataSource - 1.2.2 * controllers - 1.2.2 * codecs - 1.2.2 * jqueryUi - 1.8-SNAPSHOT * grailsUi - 1.2-SNAPSHOT * domainClass - 1.2.2 * mimeTypes - 1.2.2 * scaffolding - 1.2.2 * converters - 1.2.2 * hibernate - 1.2.2 * validation - 1.2.2 * services - 1.2.2 Can you give me any pointer?

    Read the article

  • How to rename an existing Grails application

    - by Johan Pelgrim
    Hi there, Does anybody know how to (easily) "rename" an existing grails application? I'm running into this because my PaaS provider does not allow me to delete a subscription... So I want to deploy my application under a different name. Of course, I can do this manually, but I think it might be a useful 'top-level' script (i.e. "grails rename-app newappname") Manual hints: When I do a "grails create-app myappname" I can see the myappname exists in the following files (and filenames)... Of course this is done by the create-app script, which replaces @...@ tokens in the template. I guess once they are replaced, it's not trivial to do a rename. ./.project: <name>myappname</name> ./application.properties:app.name=myappname ./build.xml:<project xmlns:ivy="antlib:org.apache.ivy.ant" name="myappname" default="test"> ./ivy.xml: <info organisation="org.example" module="myappname"/> ./myappname-test.launch:<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="myappname"/> ./myappname.launch:<listEntry value="/myappname"/> ./myappname.launch:<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="myappname" path="1" type="4"/> "/> ./myappname.launch:<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="myappname"/> ./myappname.launch:<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir="${project_loc:myappname}" -Dserver.port=8080 -Dgrails.env=development"/> ./myappname.tmproj: <string>myappname.launch</string> And of course... the top-level directory name is "myappname" Any hints, or information about ongoing initiatives in this area are welcome Greetz, Johan

    Read the article

  • ASP.NET MVC 2 validation using DTOs instead of domain entities

    - by Kevin Pang
    I'm struggling to mesh two best practices together: Using DataAnnotations + ModelBinding for validation in ASP.NET MVC 2 Using DTOs instead of domain entities when passing data via the ViewModel If I want to pass over DTOs instead of domain entities, then leveraging DataAnnotations + ModelBinding for validation would require me to specify validation attributes on my DTO classes. This results in a lot of duplicated work since multiple DTOs may hold overlapping fields with the same validation restrictions. This means that any time I change a validation rule in my domain, I have to go find all DTOs that correspond with that value and update their validation attributes.

    Read the article

  • WPF Validation with ContentPresenter

    - by Chris
    Hi, I have a WPF user control which needs to validate some fields. It is bound to a class implementing IDataErrorInfo. When I set the user control as the content of my ContentPresenter in another, already open, window, I can see validation occurring, and error messages being returned, however, I don't get any validation adorner - e.g. the default red outline. If I enter the field and leave it (triggering re-validation) the validation adorner appears. Also, if I show the user control in it's own window it shows the validation adorner immediately. (I'm using Caliburn IResults to do this underneath, e.g. Show.Dialog<VM>(); but I suspect this isn't related) Can anyone offer any suggestion why the validation adorners aren't appearing immediately. (I had guessed animation on my ContentPresenter ContentChanged, however, I have removed this and still experience the problem. thanks, Chris

    Read the article

  • Is there a way to validates_presence_of only one time? (to skip that validation once the user's been

    - by GoodGets
    So, I'd like for a user to see an error message if he submits a comment and the :name is blank (typical error message, don't need help with that). However, I'd then like to allow the user to skip that validation once he's been notified that "we like all comments to have a name." So, he submits the comment once, sees the notification, then can submit the form again unchanged if he really doesn't want to add a name, and the validates_presences_of :name is skipped. But, I'm not sure how to go about doing this. I thought about checking to see where the request is coming from, but after a create, errors are handed off to the "new" action, which is the same as actual "new" comments. I then thought about checking to see if flash[errors] were present, but that won't work because there are other validations a comment has to pass. Finally, I thought about trying a validates_presences_of :name, :unless = :notified but wasn't sure how to define notified. I honestly hate asking such an open ended question, but wasn't sure where to get started. So, is there a way to just check a certain validation once?

    Read the article

  • Data validation best practices: how can I better construct user feedback?

    - by Cory Larson
    Data validation, whether it be domain object, form, or any other type of input validation, could theoretically be part of any development effort, no matter its size or complexity. I sometimes find myself writing informational or error messages that might seem harsh or demanding to unsuspecting users, and frankly I feel like there must be a better way to describe the validation problem to the user. I know that this topic is subjective and argumentative. I've migrated this question from StackOverflow where I originally asked it with little response. Basically, I'm looking for good resources on data validation and user feedback that results from it at a theoretical level. Topics and questions I'm interested in are: Content Should I be describing what the user did correctly or incorrectly, or simply what was expected? How much detail can the user read before they get annoyed? (e.g. Is "Username cannot exceed 20 characters." enough, or should it be described more fully, such as "The username cannot be empty, and must be at least 6 characters but cannot exceed 30 characters."?) Grammar How do I decide between phrases like "must not," "may not," or "cannot"? Delivery This can depend on the project, but how should the information be delivered to the user? Should it be obtrusive (e.g. JavaScript alerts) or friendly? Should they be displayed prominently? Immediately (i.e. without confirmation steps, etc.)? Logging Do you bother logging validation errors? Internationalization Some cultures prefer or better understand directness over subtlety and vice-versa (e.g. "Don't do that!" vs. "Please check what you've done."). How do I cater to the majority of users? I may edit this list as I think more about the topic, but I'm genuinely interested in proper user feedback techniques. I'm looking for things like research results, poll results, etc. I've developed and refined my own techniques over the years that users seem to be okay with, but I work in an environment where the users prefer to adapt to what you give them over speaking up about things they don't like. I'm interested in hearing your experiences in addition to any resources to which you may be able to point me.

    Read the article

  • Data validation best practices: how can I better construct user feedback?

    - by Cory Larson
    Data validation, whether it be domain object, form, or any other type of input validation, could theoretically be part of any development effort, no matter its size or complexity. I sometimes find myself writing informational or error messages that might seem harsh or demanding to unsuspecting users, and frankly I feel like there must be a better way to describe the validation problem to the user. I know that this topic is subjective and argumentative. StackOverflow might not be the proper channel for diving into this subject, but like I've mentioned, we all run into this at some point or another. There are so many StackExchange sites now; if there is a better one, feel free to share! Basically, I'm looking for good resources on data validation and user feedback that results from it at a theoretical level. Topics and questions I'm interested in are: Content Should I be describing what the user did correctly or incorrectly, or simply what was expected? How much detail can the user read before they get annoyed? (e.g. Is "Username cannot exceed 20 characters." enough, or should it be described more fully, such as "The username cannot be empty, and must be at least 6 characters but cannot exceed 30 characters."?) Grammar How do I decide between phrases like "must not," "may not," or "cannot"? Delivery This can depend on the project, but how should the information be delivered to the user? Should it be obtrusive (e.g. JavaScript alerts) or friendly? Should they be displayed prominently? Immediately (i.e. without confirmation steps, etc.)? Logging Do you bother logging validation errors? Internationalization Some cultures prefer or better understand directness over subtlety and vice-versa (e.g. "Don't do that!" vs. "Please check what you've done."). How do I cater to the majority of users? I may edit this list as I think more about the topic, but I'm genuinely interest in proper user feedback techniques. I'm looking for things like research results, poll results, etc. I've developed and refined my own techniques over the years that users seem to be okay with, but I work in an environment where the users prefer to adapt to what you give them over speaking up about things they don't like. I'm interested in hearing your experiences in addition to any resources to which you may be able to point me.

    Read the article

  • Maven grails plugin issue

    - by Jack
    I'm trying to create the pom for an existing grails project via: mvn grails:create-pom -Dourcompany.com Now, we have our maven repository available in a local nexus repo: http://ourcompany.com/nexus But when i run the above, i get the below error Downloading: http://ourcompany.com/nexus/content/groups/public/ourcompany/com/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.jar [INFO] Unable to find resource 'ourcompany.com:hibernate-core:jar:3.3.1.GA' in repository central (http://repo1.maven.org/maven2) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR But it is in there at simply: http://ourcompany.com/nexus/content/groups/public/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.jar Ie, w/o the "ourcompany.com" path. From my perspective, it should just try to pull down hibernate w/o inserting the groupId, but maybe i'm not understanding how i'm supposed to run this command?

    Read the article

  • Intellij Grails and Git

    - by WaZ
    I want to backup my code using smart Git. As a start I am a bit confused, IntelliJ has created two folders for my GRails project: these reside in 1) C:\Documents and Settings\me\.grails\1.2.1\projects and 2) C:\Documents and Settings\me\IdeaProjects\ The 1) contains a plugins folder which contains directories and files of plugins I am using inside my project. Do I have to include both 1) and 2) directories inside GIT? If yes what can I ignore? If no which of the files do I have to include Thanks, Much appreciated, WB

    Read the article

  • Grails URL's with Tomcat/Apache ProxyPass

    - by intargc
    Grails tends to write out the URL for everything that uses its tags as /appName/whatever. For instance, if I use the tag: <g:javascript library="jquery"/> the resulting tag is <script src="/appName/jquery/jquery.js"></script> This causes an issue with using ProxyPass with Apache/Tomcat. All of my CSS, JS, Images and links have that /appName prefixed to them. Is there a way to work around this with ProxyPass or possibly a way for Grails to not prefix the appName to the front of all of my URL's?

    Read the article

  • Spring Webflow in Grails keeping plenty of hibernate sessions open

    - by Pavel P
    Hi, I have an Internet app running on Grails 1.1.2 and it integrates Spring WebFlow mechanism. The problem is that there are some bots ignoring robots.txt and are entering the flow quite often. Because second step of the flow needs some human intelligence, the bot leaves open flow after the first step. This causes a lot of open flows which leades to a lot of abandoned open hibernate sessions. Do you know some common clean-up mechanism for this kind of unattended flows (plus hibernate sessions) in Grails+Spring WebFlow? Thanks, Pavel

    Read the article

  • Getting the username in Twitter using OAuth 0.1.1 Grails plugin

    - by firnnauriel
    anyone had tried using http://www.grails.org/plugin/oauth? i'm trying it in twitter.com and i'm having an issue on getting the username or accessing this API: http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0verify_credentials here's the code in my callback URL: def twitterCallback = { def response = oauthService.accessResource('http://api.twitter.com/1/account/verify_credentials.json','twitter', session.oauthToken) log.debug "response: ${response}" } i keep getting this error: 2010-04-22 14:32:56,842 [http-8081-1] WARN httpclient.HttpMethodBase - Cookie rejected: "$Version=0; _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCMQcOCQoAToHaWQiJThiYWY4MGI1YTY1M2U0%250AYTRhNjAzYTA2NTBmNjkzZTYwIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--31d191141bf32e0489967492692f1e77fc9e1845; $Path=/; $Domain=.twitter.com". Illegal domain attribute ".twitter.com". Domain of origin: "twitter.com" 2010-04-22 14:32:56,854 [http-8081-1] INFO auth.AuthChallengeProcessor - basic authentication scheme selected 2010-04-22 14:32:56,856 [http-8081-1] INFO httpclient.HttpMethodDirector - No credentials available for BASIC 'Twitter API'@twitter.com:80 2010-04-22 14:32:56,865 [http-8081-1] ERROR errors.GrailsExceptionResolver - null it seems that it uses BASIC authentication instead of OAuth. any ideas? or is there an issue in the OAuth Grails plugin? thanks.

    Read the article

  • How to find the physical path of a GSP file in a deployed grails application

    - by Deepak Mittal
    I need to find out the physical path of a grails GSP file. My requirement is that I want to create a new layout file at run-time and use that in the application. I have been able to achieve this without problem when the application runs on jetty (grails run-app), however, when I deploy the app on Jboss, the path at which the file needs to be created changes. So, ideally I would like to find out at runtime using some magical utility the path of a particular GSP (lets say main.gsp layout file) and I need to create my new layout in the same directory in which main.gsp reside. Any pointers? -Deepak

    Read the article

  • Grails MySql processList

    - by Masiar Ighani
    Hello, i have a grails application with a webflow. I store my inner flow objects of interest in the converstaion scope. After entering and leaving the flow a few times, i see that the single user connected to the DB (MySql) generates a lot of threads on the MySql Server which are not released. The processlist in mysql show me the threads in sleeping mode and a netstat on the client shows me established connections to the mysql server. I assume the connections are held active and not released. But why is that? What do grails exactly do when entering and leaving a flow? Why are so many connections opened and not closed? Any help would be appreciated. regards, masiar

    Read the article

  • No Hibernate Session bound to thread grails

    - by naresh
    Actually we've lot of quartz jobs in our application. For some time all of the jobs work fine. After some time all jobs are throwing the following exception. org.quartz.JobExecutionException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here [See nested exception: java.lang.IllegalStateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here] at grails.plugins.quartz.QuartzDisplayJob.execute(QuartzDisplayJob.groovy:37) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: java.lang.IllegalStateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here at grails.plugins.quartz.QuartzDisplayJob.execute(QuartzDisplayJob.groovy:29) ... 2 more

    Read the article

  • Displaying desired properties from search results with grails compass

    - by ombud
    Hi, I've been stumped with the problem of displaying a selected set of properties returned as a result via a Compass query in grails. I have 300 columns in my domain class and what I'd like to do is to return ONLY THOSE values I specify (around 10 - 15 properties/fields/columns). All the 300 columns have been indexed, btw. I know I can do this using Lucene by cycling through returned hits and selectively calling a=getField(column_name), et c. My qiuestion is, how do I do the same thing using thee Compass Grails plugin ? Any help will gratefully be appreciated. Thanks in anticipation, Ombud

    Read the article

  • Producer/consumer in Grails?

    - by Mulone
    Hi all, I'm trying to implement a Consumer/Producer app in Grails, after several unsuccessful attempts at implementing concurrent threads. Basically I want to store all the events coming from a clients (through separate AJAX calls) in a single queue and then process such a queue in a linear way as soon as new events are added. This looks like a Producer/Consumer problem: http://en.wikipedia.org/wiki/Producer-consumer_problem How can I implement this in Grails (maybe with a timer or even better by generating an event 'process queue')? Basically I'd like to a have a singleton service waiting for new events in the queue and processing them linearly (even if the queue is loaded by several concurrent processes). Any hints? Cheers!

    Read the article

  • Grails/Compass question - How can I change the compqass Connection to point to a different directory

    - by ombud
    Hi, I use the Searchable plugin with Grails I have the need to change the directory to which Compass points to, depending upon a UI choice by the user. Normally, this value is set in the compassConnection variable of the searchable map in grails-app/conf/Searchable.groovy, like so, and gets called at app startup time: searchable { compassConnection = new File( "/path/to/index/file/directory" ).absolutePath ... } To do what I need to do, I think that I need to get a handle into the compass config variable and then call config.setConnection("/new/path/to/index/dir") I don't know how I can get a reference to the config compass variable Am I right in assuming that I need to call setConnection(String) only, or is(are) there any other step(s) I need to take? Really appreciate any help that I can get, Shailen

    Read the article

  • How much of Grails GORM to test?

    - by Lloyd Meinholz
    Is there a "best practice" or defacto standard with how much of the GORM functionality one should test in the unit/functional tests? My take is that one should probably do most of the domain testing as functional tests so that you get the full grails environment. But what do you test? Inserts, updates, deletes? Do you test constraints even though they were probably more thoroughly tested by the grails release? Or do you just assume that GORM does what it is supposed to do and move to other parts of the application?

    Read the article

  • Domain Validation in a CQRS architecture

    - by Jupaol
    Basically I want to know if there is a better way to validate my domain entities. This is how I am planning to do it but I would like your opinion The first approach I considered was: class Customer : EntityBase<Customer> { public void ChangeEmail(string email) { if(string.IsNullOrWhitespace(email)) throw new DomainException(“...”); if(!email.IsEmail()) throw new DomainException(); if(email.Contains(“@mailinator.com”)) throw new DomainException(); } } I actually do not like this validation because even when I am encapsulating the validation logic in the correct entity, this is violating the Open/Close principle (Open for extension but Close for modification) and I have found that violating this principle, code maintenance becomes a real pain when the application grows up in complexity. Why? Because domain rules change more often than we would like to admit, and if the rules are hidden and embedded in an entity like this, they are hard to test, hard to read, hard to maintain but the real reason why I do not like this approach is: if the validation rules change, I have to come and edit my domain entity. This has been a really simple example but in RL the validation could be more complex So following the philosophy of Udi Dahan, making roles explicit, and the recommendation from Eric Evans in the blue book, the next try was to implement the specification pattern, something like this class EmailDomainIsAllowedSpecification : IDomainSpecification<Customer> { private INotAllowedEmailDomainsResolver invalidEmailDomainsResolver; public bool IsSatisfiedBy(Customer customer) { return !this.invalidEmailDomainsResolver.GetInvalidEmailDomains().Contains(customer.Email); } } But then I realize that in order to follow this approach I had to mutate my entities first in order to pass the value being valdiated, in this case the email, but mutating them would cause my domain events being fired which I wouldn’t like to happen until the new email is valid So after considering these approaches, I came out with this one, since I am going to implement a CQRS architecture: class EmailDomainIsAllowedValidator : IDomainInvariantValidator<Customer, ChangeEmailCommand> { public void IsValid(Customer entity, ChangeEmailCommand command) { if(!command.Email.HasValidDomain()) throw new DomainException(“...”); } } Well that’s the main idea, the entity is passed to the validator in case we need some value from the entity to perform the validation, the command contains the data coming from the user and since the validators are considered injectable objects they could have external dependencies injected if the validation requires it. Now the dilemma, I am happy with a design like this because my validation is encapsulated in individual objects which brings many advantages: easy unit test, easy to maintain, domain invariants are explicitly expressed using the Ubiquitous Language, easy to extend, validation logic is centralized and validators can be used together to enforce complex domain rules. And even when I know I am placing the validation of my entities outside of them (You could argue a code smell - Anemic Domain) but I think the trade-off is acceptable But there is one thing that I have not figured out how to implement it in a clean way. How should I use this components... Since they will be injected, they won’t fit naturally inside my domain entities, so basically I see two options: Pass the validators to each method of my entity Validate my objects externally (from the command handler) I am not happy with the option 1 so I would explain how I would do it with the option 2 class ChangeEmailCommandHandler : ICommandHandler<ChangeEmailCommand> { public void Execute(ChangeEmailCommand command) { private IEnumerable<IDomainInvariantValidator> validators; // here I would get the validators required for this command injected, and in here I would validate them, something like this using (var t = this.unitOfWork.BeginTransaction()) { var customer = this.unitOfWork.Get<Customer>(command.CustomerId); this.validators.ForEach(x =. x.IsValid(customer, command)); // here I know the command is valid // the call to ChangeEmail will fire domain events as needed customer.ChangeEmail(command.Email); t.Commit(); } } } Well this is it. Can you give me your thoughts about this or share your experiences with Domain entities validation EDIT I think it is not clear from my question, but the real problem is: Hiding the domain rules has serious implications in the future maintainability of the application, and also domain rules change often during the life-cycle of the app. Hence implementing them with this in mind would let us extend them easily. Now imagine in the future a rules engine is implemented, if the rules are encapsulated outside of the domain entities, this change would be easier to implement

    Read the article

  • Grails Testing hickups

    - by egervari
    I have two testing questions. Both are probably easily answered. The first is that I wrote this unit test in Grails: void testCount() { mockDomain(UserAccount) new UserAccount(firstName: "Ken").save() new UserAccount(firstName: "Bob").save() new UserAccount(firstName: "Dave").save() assertEquals(3, UserAccount.count()) } For some reason, I get 0 returned back. Did I forget to do something? The second question is for those who use IDEA. What should I be running - IDEA's junit tests, or grails targets? I have two options. Also, why does IDEA say that my tests pass and it provides a green light even though the test above actually fails? This will really drive me nuts if I have to check the test reports in html every time I run my tests..... Help?

    Read the article

  • Grails LDAP authentication failed

    - by Leo
    Hi, guys I am developing a web app by using Grails and using Grails LDAP as my Authentication mechanism. However, i always get following error: {Error 500: Cannot pass null or empty values to constructor Servlet: default URI: /ldap-app/j_spring_security_check Exception Message: Cannot pass null or empty values to constructor Caused by: Cannot pass null or empty values to constructor Class: GrailsAuthenticationProcessingFilter } My SecurityConfig.groovy file is : security { // see DefaultSecurityConfig.groovy for all settable/overridable properties active = true loginUserDomainClass = "User" authorityDomainClass = "Role" requestMapClass = "Requestmap" useLdap = true ldapRetrieveDatabaseRoles = false ldapRetrieveGroupRoles = false ldapServer = 'ldap://worf-mi.dapc.kao.au:389' ldapManagerDn = 'CN=sa-ldap-its,OU=Unix Servers for Kerberos,OU=Information Technology Services,OU=Special Accounts,DC=nexus,DC=dpac,DC=cn' ldapManagerPassword = 'Asdf1234' ldapSearchBase = 'OU=People,DC=nexus,DC=dpac,DC=cn' ldapSearchFilter = '(&(cn={0})(objectClass=user))' }

    Read the article

  • Track pageviews in Google Analytics on partial url of Grails application

    - by Pieter van Gent
    For my Grails application I want to set up Google Analytics to track only "partial" url's. I 'll explain: a typical Grails url consists of the following parts: domain + application-name + controller + action + id e.g. www.mydomain.com/myapp/controller/action/12345 As far as I understand for Google Analytics the page to be tracked is identified by the entire url. For my purpose I'm not interested in the id part of the url: I want to know which actions have been performed, but I need not know for which id the action was executed. And of course I would like a generic solution, because I have multiple controllers and multiple actions... Maybe some kind of filter stating "I want to track pages 3 levels deep (/myapp/controller/action)" would do? Or a filter stating "exclude everything from url after the last /"? Any help would be much appreciated. Kind regards, Pieter

    Read the article

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