Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Kim Kantola

Ranch Hand
+ Follow
since May 17, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kim Kantola

Hi All,
I am using bpm drools for the first time. In my .drl file, I have syntax like this :




My question is, can a drools file access properties so that I could make the values shown above "Kimberly" and "someValue" be grabbed from the configurable properties file?
The app is Java with Spring using Mule ESB.

I could see it being something like this :



where my config file had properties



I can't see any example of drools files getting data from a properties file, so maybe this is not a good practice ?
Hi All,
I am new to SOAP and am trying to figure out the best way to map SOAP Service methods. If I have a HelloWorld Soap Service that has two methods, one "helloAmerica", and another "helloEurope", would I have a url like



And then have the method I want to call of that service as part of the SOAP message ? OR would I have a separate URL per Soap Method like this :



Thanks,
Kim
5 years ago
Oh, just thought of something I didn't mention which may make a difference. The ruby app is sending the payload to a Java Spring application.
I am debuging the Java application and that is where I see the malformed XML arriving. I am taking the xml off the request in a controller method on the Java side.


Thank you so much for sticking with me on this !!
9 years ago
Thanks, yes that is exactly what my xml looks like. I do need to pass the string as xml.
9 years ago
Thank you for your reply Paul,
I have tried to escape the character like this :

& amp; (no space between & and amp; but couldn't get it to show up here any other way)

but it did not help. Would you recommend a different way to treat the & ?
Thanks,
Kim
9 years ago
Hi All,
I have code that works fine in some circumstances :


Where data is an xml string.

This code works fine unless my xml string has any non ascii characters in it. For examaple, if the xml is this

The & character seems to break this.
On the receiving end of the post, I get the xml all the way up to but not including the & character.


I tried to do the following : request.content_type = 'text/xml', but that actually made things worse!
Any tips?
Thanks,
Kim
9 years ago
Hello All,
I am seeing some behavior that I would not expect, and am hoping someone may shed some light on it. I have a Controller class in my Spring app which returns a url like this when the submit button of the page is clicked :


I have an interceptor class which does this :


I would have expected the Interceptor class to put the new key/value pair into the ModelMap and then to continue forwarding to the original url of


However, what is happening is the key value pair are being added to the end of the url, so when my page comes up I can see this url :


I can not seem to find documentation to explain this behavior and instruct on how to deal with this.
Any help would be greatly appreciated,
Thanks,
Kim
9 years ago
Marc, this is EXACTLY the kind of information I needed!! Can't thank you enough.
Some times when you are new to something, its hard to even know what you are looking for. I have spent hours on different sites and in books but was having no luck. It was driving me crazy not understanding why the path was working that way.

Thank you again so much!
Kim
10 years ago
Hi All,
I am still fairly new to ruby and rails, and so may not have the correct vocabulary to even ask this question.
I have a form which posts to a save method in an action, this action path is very easy to understand, go to tasks_controller and go to save method there.


What is confusing me is this route at the very end of the save method in tasks_controller.rb.


What confuses me here is that there is no method name, just the task controller name. This redirect ends up calling the method "show" in the same controller. My question is why? How does it know to call the show method when it just mentions the controller name ?

Thanks for any help!
Kim
10 years ago
Thank you Gregg,
I had some groovy code that was determining the contents of a list which would then be used on the page as a drop down list. I know this sounds strange, but I was getting all the values from a database, but have to replace one of the values with a different string. Something like

List = apple, pear, peach

and I want the drop down to read

List = apple, pear, banana

So, I wanted to store the string "banana" in the messages.properties file.

I have decided to put it into a different properties file, thanks for your input.
10 years ago
Hi All,
I am having a hard time finding documentation on something, which is making me think it is possibly something I shouldn't be trying to do. I know how to access the values in messages.properties from a gsp file using the tag <g:message, however, I have a couple of groovy files that I need to load a configurable string file in, and I wanted to put that string into messages.properties, however, I cannot seem to find a way to access the messages.properties files from the groovy class. The only thing I have found is how to do this in a controller,

>

But what I need is to load a string that is not an error message, it is something I am going to put into a list that will provide for a drop down list.

If anyone knows of a good resource they could point me to, I would appreciate it.
Thanks!
Kim
10 years ago
Hi,
Still researching this and I realize that I may be attacking the problem the wrong way. When I do a Date now = new Date();, I wanted to make sure now was in UTC, which I now read is the default for the java.util.Date object.
So, as long as I make my Date objects myself, they are in UTC.

So, I guess my question is more in comparing dates, if I create Date now = new Date();

And then a user passes a String value to my program of "March 18, 2010 1:05 PM PST",

and I want to convert that String to a date and then find the difference between the two dates, How would I make sure I am not comparing apples to oranges ?

For example I want to say now - (Date value of String 1:05 PM PST) = some value.

I would want the calculation to return the same elapsed time if an equivalent PST or EST string was passed to the program .

Thanks, this is hurting my brain!
Kim
10 years ago
Hi All,
I am VERY new to Groovy, and am trying to get a current Time value. My code does execute, but I am not sure I am getting the correct value.
What I want to do is get the current Date/Time in UTC, which I understand should be roughly the same as GMT.
I am running this code on a machine that is in Eastern Standard time. So, assuming it is 5:00 PM here, which is (UTC-4 with DST), I would think that my method
should return 9:00 PM as the current time.
However, I get the value 5:00 PM returned. Maybe something in Groovy/Grails is switching the value to the current system time zone?
I am guessing that I must be missing something in the big picture here. Thanks for any advice!!!


Kim
10 years ago
Hello,
I cannot deploy my application right now with the following hibernate mapping file, NamedQuery.hbm.xml.
When I try to deploy I get a NullPointerException. When I remove this file from my data folder with all the other mapping files, the app WILL deploy fine. I can't determine what is wrong.
The one thing that does stand out in my mind is that the other .hbm.xml files that I have are automatically generated from java files using an xDoclet command in my build file, however this one I created from hand, there is no correspodning java file.

I feel like I am missing something obvious, does anyone spot something wrong here?
Thanks!

Thank you very much, yes, using the "%" did the trick.

It however brought me to a new problem, one of the fields I am trying to compare is a date, so if I have this in my query:


as part of my query, and my DOB value is null so I do this :


I then get the follwing error :

java.lang.ClassCastException
at org.hibernate.type.DateType.toString(DateType.java:78)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:89)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:63)
at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:491)


Is there a special wildcard to use for dates ?

Thanks!