Hello, guys.
I`m trying to dynamically represent the changes of coordinates of a groovy domain object via Google Maps API. The object has fields:
Double lat
Double lng
and a method:
void flyTo(lat, lng){
Thread.start(){
while (locked){
changeCoords (this)
this.save()
}
}
and here is a JS to repopulate changes to ...
Hi,
In a GSP, is it possible to create a direct link to another GSP? I know I can use:
<g:createLink controller="user" action="foo"/>
and in UserController define the foo action to just show the corresponding GSP
class UserController {
def foo = {}
}
But is there any way I can achieve the same result without having to create t...
Is it possible to share authentication between several grails application?
We have an app that grown too big and it is a time to break it to several apps, but we can't figure out how to share authentication between apps.
our app is grails with acegi plugin and it is deployed on tomcat server.
question assumes that we do not introduce ...
I need to pass a correct URL to a javascript function in one of my GSPs. I don't want to just hard code it just in case the mappings for that URL ever change.
I know in Rails I would use the url_for method such as:
<%= url_for :controller => 'something', :action => 'edit', :id => 3 %>
How would I do this in Grails? I can't seem to ...
Lets say I have the following one-to-many relationship:
Site has many Users
User belongs to one Site
I've setup the relationship like this
class Site {
static hasMany = [users:User]
...
}
and
class User {
static belongsTo = [site:Site]
int number
String username
...
}
Basically I want to update the userna...
I'm trying to use the Grail formRemote tag. I'm using it like so:
<g:formRemote name="newRule" url="https://somesite/somescript">
However, I keep getting the error:
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.grails.plugins.web.taglib.JavascriptTagLib.deepClone() is applicable for argument typ...
The plugin (Nimble 0.3) I am using in my grails application, includes some controllers and associated actions. I want to change (slightly) some actions behavior, and I was wondering how I can achieve that.
Can I create a child controller that inherits from my plugin controller and override some of the action implementation?
Or, can I c...
Hi,
When hot deployed grails war in tomcat and refresh page, i was getting below error :
1 Feb, 2010 7:00:51 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet view-servlet threw exception
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before a...
I need to calculate the time elapsed from one specific date till now and display it with the same format as StackOverflow questions, i.e.:
15s ago
2min ago
2hours ago
2days ago
25th Dec 08
Do you know how to achieve it with the Java Joda Time library? Is there a helper method out there that already implements it, or should I write the...
I'm trying to take advantage of the fact that groovy is more dynamic than java.
I'd like to have a block of code that does
TypeA type = //do something to build an object
TypeA dbType = TypeA.findBySomethingAndSomething(something, somethingelse)
if(dbType != null)
type.id = dbType.id
type.save()
but that can work for multiple object...
Hi again,
authentication via LDAP works like a charm, however, when I assign a role to a user and secure a page in the requestmap (like /books/show/** and ROLE_USER) this only works for local-only users, not for users authenticated via LDAP. (IS_AUTHENTICATED_FULLY works, though)
How can I fix that?
...
Grails 1.1 onwards has 'encodeAsMD5' available on Strings -- is there a way to provide a salt for the function?
Typical usage:
${myString.encodeAsMD5()}
Another option would be to use the Apache DigestUtils class.
I'm not using this to do password hashing -- instead, I'm using it for a verification mechanism to determine when a requ...
I'm trying to create my own CRUD controller in grails for the stuff that the scaffolding won't do.
Instead of maintaining code for a controller for each domain, I'd like to have one controller that can look after any domain for the generic CRUD calls.. as the only difference is the domain class name.
Using the example of domain class J...
Is it possible to set cookies on response when the return render type is set as json?
I can set cookies on the response object when returning with a standard render type and later on, I'm able to get it back on the subsequent request. However, if I were to set the cookies while rendering the return values as json, I can't seem to get ba...
I'm using grails to build an application that functions primarily as a service framework. My question is: Can services be secured in the same fashion as controllers?
uri-based example:
class SecurityFilters {
def filters = {
all(uri: "/**") {
before = {
// Ignore direct views (e.g. the default main index page).
...
I'm trying to define a Camel context in my Grails application.
resource.groovy:
xmlns camel: 'http://camel.apache.org/schema/spring'
camel {
camelContext(id:'camelContext') {
}
}
Results in a stacktrace containing:
2010-02-03 13:24:42,209 [main] ERROR spring.GrailsRuntimeConfigurator - [RuntimeConfiguration] Unable to l...
I was asked by my client to print the receipt into Epson TM U220 (http://pos.epson.com/products/TM-U220.htm) from my web application. I have no idea how to do that. is there any java applets or something else that I can use for printing ? or should i use jasper (is jasper has lib for helping to cope this problem?)
(if there is flash apps...
I want to refer to an image in my main stylesheet for a Grails app and I can't get it to work. My image lives in the standard location in my Grails app...
project\web-app\images\outbound-blue.png
In my stylesheet I want to use it as a background image for a class...
.messageimg {
height:17px;
width:16px;
background-image...
How do you set the selectedIndex on a <g:select> tag with a value from the list? I have a page that allows you to add a record. the page then goes to a view containing a g:select and i want the g:select to default to that item i just inserted into the database.
I tried passing the new object in the flash but i can't figure out how to ge...
I have a filter setup to get executed for all actions and it is executed once per request unless ajax get request is sent to the server. When it's an ajax get request, the filter gets executed twice but I see the browser sending only one request to the server. Is there a way to get the filter to fire only once per request?
Here's how m...