Hi all. I am really stuck here. I am creating an XML document with Groovy 1.7 and everything is working except one section is being escaped when it shouldn't.
I am starting out like this:
triadDoc = new XmlSlurper().parse(xmlTriadMessageDocumentPath)
writer = new StringWriter()
xmlBuilder = new Stre...
Dear All:
I am reading here
http://groovy.codehaus.org/modules/http-builder/doc/handlers.html
"In cases where a response sends a redirect status code, this is handled internally by Apache HttpClient, which by default will simply follow the redirect by re-sending the request to the new URL. You do not need to do anything special in order...
Dear All:
I would like to evaluate an XPath expression relative to a given
element.
I have been reading here:
http://www.w3schools.com/xpath/default.asp
And it seems like one of the syntaxes below should work (esp no leading
slash or descendant:)
However, none seem to work in HTMLUnit. Any help much appreciated (oh
this is a groovy s...
Here is the lay of the land. I have an app that I have created. I uninstalled hibernate, installed app-engine plugin and am using jdo.
I am able to create a domain-class but the when I run generate-all I run into the following error.
Oh and I did try just generating the controller for the domain class and that seemed to work fine but t...
Hey!
I have a cool bit of dojo running where I click a button - and it brings a success message on the screen via javascript. Is it possible to issue a call to a server side Groovy script foo.groovy from within this Javascript - because not only do I want to show the cool success message - but I need to do some work in the background at...
i notice that Java has a number of ancillary scripting languages. Clojure and Groovy for example. My understanding is that these can be used when the full might and power of Java does not need to be applied and a speedy cludge can be hacked in Groovy/Clojure. But at the end of the day the scripting tools contribution gets compiled into t...
In examples of groovy code I find the -> operator everywhere, but the groovy tutorials nor the book I have seem to provide any explaination as to what this means.
...
I've created a groovlet that will act as a sort of HTTP proxy. It accepts GET requests and then makes web service calls based on the URL provided in the request.
Here's the code I've got so far:
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0')
import groovyx.net.http.*
import static groovy...
Dear All:
I am doing this (in Groovy):
def cookies=webClient.cookieManager.cookies
def http=new HTTPBuilder("myurl")
http.request(POST) {
def headersCookie=''
cookies.eachWithIndex() { cookie,i->
if (i>0) {
headersCookie+='; '
}
headersCookie+=cookie.getName()+"="+cookie.getValue()
}
headers.'Cookie'=headersCook...
Hi, today twitting with a colleague http://bit.ly/addZQx, he said me that Groovy is like C# but without LINQ.
I don't know much about LINQ, but I answered him that Groovy has similarities to LINQ http://bit.ly/bKNrlj, for example, Groovy's class DataSet.
Can you tell me more about similarities / differences between Groovy and LINQ (C#)...
Dear All:
I am quite confused... I am reading here and BasicClientCookie clearly implements Serializable per JavaDoc:
http://hc.apache.org/httpcomponents-client/httpclient/apidocs/org/apache/http/impl/cookie/BasicClientCookie.html
However, my simple Groovy script:
#!/usr/bin/env groovy
@Grapes(
@Grab(group='org.apache.httpcomponen...
I am looking to use java or groovy to get the md5 checksum of a complete directory.
I have to copy directories for source to target, checksum source and target, and after delete source directories.
I find this script for files, but how to do the same thing with directories ?
import java.security.MessageDigest
def generateMD5(fin...
I'm trying to create a small HTTP proxy that can re-write the request/headers as needed to suit my requirements. If one already exists, please, point me to it. Otherwise...
I've written something that ALMOST works. It can do the proxy function, but not the re-write (yet). Problem is, I can't detect when the remote socket has been cl...
Dear All:
Just wondering... I have some code (disabling certain logging output) that I'd like to be run before all tests...
I do not see any such examples for JUnit/Groovy testing in the samples directory... is there a good/correct place to put such code?
Thank you!
Misha
p.s. I am using the 0.9 preview 3 version.
...
Say, I have this type of webflow:
def myFlow = {
state1 {
}
on("next").to("stateAct")
stateAct {
action {
... DB stuff ...
}
}
on("success").to("state2")
state2 {
}
on("prev").to("state1")
}
Now, the contents of "stateAct" is common between state1 and state2. Meaning, i...
My question is about putting data elements (from groovy script) in the response in SoapUI.
I've an array of data that I would like to put in my response (in different tags/elements)
I'm aware of putting a simple element like this:
The element "MyName" in the Xml response:
<ns:MyName>${MyName}</ns:MyName>
Is mapped from the Groov...
Dear All:
I am using:
def idx=parent.item.children().indexOf(myElement)
if (idx+1<parent.children().size()) {
def message=parent.children()[idx+1]
println message.text()
}
To find the element message which is next after myelement in the parent.
However, it seems there must be a Groovier way, no?
Thank you
Misha
...
Once I post JSON data to a url in Grails, how can I get access to that data inside of the controller?
...
Ok, this isn't even a question:
import com.gargoylesoftware.htmlunit.HttpMethod
import com.gargoylesoftware.htmlunit.WebClient
import com.gargoylesoftware.htmlunit.WebResponseData
import com.gargoylesoftware.htmlunit.WebResponseImpl
import com.gargoylesoftware.htmlunit.util.Cookie
import com.gargoylesoftware.htmlunit.util.NameValuePair
...
Hi All!
Using Grails and the RichUI plugin to display a tree, and it works fine.
When I click one of the Nodes in the tree I show a list(table) from a controller.
I should be able to create new, edit and sort.
My problem is that pagination doesn't work and also sorting!!!
Are there anyone who has done this, or can it be done different...