bug with javascript Number.MAX_VALUE marshalling to Double

View: New views
2 Messages — Rating Filter:   Alert me  

bug with javascript Number.MAX_VALUE marshalling to Double

by Adam Hardy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wanted to send Number.MAX_VALUE to the server to a double parameter

Javascript sends this in the HTTP request: 1.7976931348623157e 308

But in org.directwebremoting.util.LocalUtil.simpleConvert(), Java's Double.valueOf(string) doesn't accept the javascript value.

but it requires 1.7976931348623157E308 instead and throws an exception with "Invalid float literal number"

This is Firefox 2.0.0.7 - I'm not sure if it's a browser thing, but I'd guess so.

Looks like it needs a bit more massaging in LocalUtil.

Thanks
Adam

Re: bug with javascript Number.MAX_VALUE marshalling to Double

by Joe Walker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks.
I've added an issue: http://getahead.org/bugs/browse/DWR-163

Joe.

On 10/4/07, Adam Hardy <adam.hardy@...> wrote:

I wanted to send Number.MAX_VALUE to the server to a double parameter

Javascript sends this in the HTTP request: 1.7976931348623157e 308

But in org.directwebremoting.util.LocalUtil.simpleConvert(), Java's
Double.valueOf(string) doesn't accept the javascript value.

but it requires 1.7976931348623157E308 instead and throws an exception with
"Invalid float literal number"

This is Firefox 2.0.0.7 - I'm not sure if it's a browser thing, but I'd
guess so.

Looks like it needs a bit more massaging in LocalUtil.

Thanks
Adam
--
View this message in context: http://www.nabble.com/bug-with-javascript-Number.MAX_VALUE-marshalling-to-Double-tf4568457.html#a13038738
Sent from the DWR - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...