Re: ScriptEngineManager throws an Error but works... why?

2012-07-03 Thread Jepse
Hi there...

Sorry for the double post! My first post didnt show up. So i thought it was 
recognised as spam. I'll be deleting it.

Actually i'm using JSNI for eval a simple fomular. I haven't familiar with 
this feature. But now it works. What is the pure Java solution this 
problem? In my search i dind't find a native soloution for evaluating 
Stings-Formulars. 

The thing what i have been curious about was, that the development mode 
throwed an error but still works on client side. 

Am Dienstag, 12. Juni 2012 12:26:52 UTC+2 schrieb Jepse:

 Hi there and hello to this group! (First Post)

 First i have to say gwt changed my programmer-life ;) Thanks for that!

 My Question:

 I'm using SctriptEngineManager in gwt shared package on client side to 
 evaluate String based Conditions (42?) or formulas. Every time GWT 
 executes the code, i receive an error in the development console... It says:
 *12:13:13.012 [ERROR] [contacts] Line 253: No source code is available 
 for type javax.script.ScriptEngineManager; did you forget to inherit a 
 required module?*

 For some other modules it simply doesn't work because the code is not 
 applicable for converting into javascript. So far all i need to know - fine.

 But ScriptEngineManager throws the same error but works... Not that i 
 don't appreciate this behaviour. But i still want to know why it throws 
 this error?

 Can anybody point me the reason? Or a better way to evaluate String based 
 conditions or formulars?

 My Code:
 ScriptEngineManager manager = new ScriptEngineManager();
 ScriptEngine engine = manager.getEngineByName(js);
 Object result = engine.eval(43);
 Boolean boolResult = (Boolean)result;


Am Dienstag, 12. Juni 2012 12:26:52 UTC+2 schrieb Jepse:

 Hi there and hello to this group! (First Post)

 First i have to say gwt changed my programmer-life ;) Thanks for that!

 My Question:

 I'm using SctriptEngineManager in gwt shared package on client side to 
 evaluate String based Conditions (42?) or formulas. Every time GWT 
 executes the code, i receive an error in the development console... It says:
 *12:13:13.012 [ERROR] [contacts] Line 253: No source code is available 
 for type javax.script.ScriptEngineManager; did you forget to inherit a 
 required module?*

 For some other modules it simply doesn't work because the code is not 
 applicable for converting into javascript. So far all i need to know - fine.

 But ScriptEngineManager throws the same error but works... Not that i 
 don't appreciate this behaviour. But i still want to know why it throws 
 this error?

 Can anybody point me the reason? Or a better way to evaluate String based 
 conditions or formulars?

 My Code:
 ScriptEngineManager manager = new ScriptEngineManager();
 ScriptEngine engine = manager.getEngineByName(js);
 Object result = engine.eval(43);
 Boolean boolResult = (Boolean)result;


Am Dienstag, 12. Juni 2012 12:26:52 UTC+2 schrieb Jepse:

 Hi there and hello to this group! (First Post)

 First i have to say gwt changed my programmer-life ;) Thanks for that!

 My Question:

 I'm using SctriptEngineManager in gwt shared package on client side to 
 evaluate String based Conditions (42?) or formulas. Every time GWT 
 executes the code, i receive an error in the development console... It says:
 *12:13:13.012 [ERROR] [contacts] Line 253: No source code is available 
 for type javax.script.ScriptEngineManager; did you forget to inherit a 
 required module?*

 For some other modules it simply doesn't work because the code is not 
 applicable for converting into javascript. So far all i need to know - fine.

 But ScriptEngineManager throws the same error but works... Not that i 
 don't appreciate this behaviour. But i still want to know why it throws 
 this error?

 Can anybody point me the reason? Or a better way to evaluate String based 
 conditions or formulars?

 My Code:
 ScriptEngineManager manager = new ScriptEngineManager();
 ScriptEngine engine = manager.getEngineByName(js);
 Object result = engine.eval(43);
 Boolean boolResult = (Boolean)result;


Am Dienstag, 12. Juni 2012 12:26:52 UTC+2 schrieb Jepse:

 Hi there and hello to this group! (First Post)

 First i have to say gwt changed my programmer-life ;) Thanks for that!

 My Question:

 I'm using SctriptEngineManager in gwt shared package on client side to 
 evaluate String based Conditions (42?) or formulas. Every time GWT 
 executes the code, i receive an error in the development console... It says:
 *12:13:13.012 [ERROR] [contacts] Line 253: No source code is available 
 for type javax.script.ScriptEngineManager; did you forget to inherit a 
 required module?*

 For some other modules it simply doesn't work because the code is not 
 applicable for converting into javascript. So far all i need to know - fine.

 But ScriptEngineManager throws the same error but works... Not that i 
 don't appreciate

Re: ScriptEngineManager

2012-06-15 Thread Philippe Lhoste

On 14/06/2012 14:39, Jepse wrote:

I'm curious about the gwt behavior with ScriptEngineManager. Everytime it comes 
over this
class it throws an error in development console. But it works fine - feels more 
like a
warning in this case:
/*No source code is available for type javax.script.ScriptEngineManager; did 
you forget to
inherit a required module?*/

But when i want to compile my projects the error is geeting:
/*[ERROR] at Field.java(271): ScriptEngineManager manager = new 
ScriptEngineManager();
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration*/

What can i do?


Do you mean you try to use the ScriptEngineManager on the client side? Like so many Java 
libraries, it cannot be converted by GWT to JavaScript... It would be interesting to see a 
Python or Groovy script to be run in the browser, but I am not sure the performance would 
be there...


Note: the development console is a different beast, actually running Java in 
the browser.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

--
You received this message because you are subscribed to the Google Groups Google 
Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: ScriptEngineManager throws an Error but works... why?

2012-06-15 Thread Philippe Lhoste

On 12/06/2012 12:26, Jepse wrote:

I'm using SctriptEngineManager in gwt shared package on client side to evaluate 
String
based Conditions (42?) or formulas. Every time GWT executes the code, i 
receive an error
in the development console... It says:
*/12:13:13.012 [ERROR] [contacts] Line 253: No source code is available for type
javax.script.ScriptEngineManager; did you forget to inherit a required module?/*

For some other modules it simply doesn't work because the code is not 
applicable for
converting into javascript. So far all i need to know - fine.

But ScriptEngineManager throws the same error but works... Not that i don't 
appreciate
this behaviour. But i still want to know why it throws this error?

Can anybody point me the reason? Or a better way to evaluate String based 
conditions or
formulars?


Duplicate message? I already answered the second message, but since it had less 
information, I also answer this one.


You use the ScriptEngineManager to run JS on a browser? Do you know that JavaScript is 
already available out of the box in browsers?
GWT allows you to access directly the JS layer, via JSNI. I actually have little 
experience in the domain, so I let you explore yourself this feature.


Note: for simple formula evaluation, there are also pure Java solutions.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

--
You received this message because you are subscribed to the Google Groups Google 
Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: ScriptEngineManager throws an Error but works... why?

2012-06-15 Thread Thomas Broyer


On Tuesday, June 12, 2012 12:26:52 PM UTC+2, Jepse wrote:

 Hi there and hello to this group! (First Post)

 First i have to say gwt changed my programmer-life ;) Thanks for that!

 My Question:

 I'm using SctriptEngineManager in gwt shared package on client side to 
 evaluate String based Conditions (42?) or formulas. Every time GWT 
 executes the code, i receive an error in the development console... It says:
 *12:13:13.012 [ERROR] [contacts] Line 253: No source code is available 
 for type javax.script.ScriptEngineManager; did you forget to inherit a 
 required module?*

 For some other modules it simply doesn't work because the code is not 
 applicable for converting into javascript. So far all i need to know - fine.

 But ScriptEngineManager throws the same error but works... Not that i 
 don't appreciate this behaviour. But i still want to know why it throws 
 this error?

 Can anybody point me the reason? Or a better way to evaluate String based 
 conditions or formulars?

 My Code:
 ScriptEngineManager manager = new ScriptEngineManager();
 ScriptEngine engine = manager.getEngineByName(js);
 Object result = engine.eval(43);
 Boolean boolResult = (Boolean)result;


Because it's referenced from within your source path (you have a source 
path=shared/ in your gwt.xml right?), GWT searches for its source code 
(and here doesn't find it and logs an error; even if you had the JRE's 
sources, it'll still log an error because there's no module with 
javax.script in its source path).
But because you don't use it in your client-side code, there's no reason it 
would fail.

Solution: move it out of your shared package, as it's a server thing 
more than a shared thing.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/o3pFgPLDsPsJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



ScriptEngineManager throws an Error but works... why?

2012-06-14 Thread Jepse
Hi there and hello to this group! (First Post)

First i have to say gwt changed my programmer-life ;) Thanks for that!

My Question:

I'm using SctriptEngineManager in gwt shared package on client side to 
evaluate String based Conditions (42?) or formulas. Every time GWT 
executes the code, i receive an error in the development console... It says:
*12:13:13.012 [ERROR] [contacts] Line 253: No source code is available for 
type javax.script.ScriptEngineManager; did you forget to inherit a required 
module?*

For some other modules it simply doesn't work because the code is not 
applicable for converting into javascript. So far all i need to know - fine.

But ScriptEngineManager throws the same error but works... Not that i don't 
appreciate this behaviour. But i still want to know why it throws this 
error?

Can anybody point me the reason? Or a better way to evaluate String based 
conditions or formulars?

My Code:
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName(js);
Object result = engine.eval(43);
Boolean boolResult = (Boolean)result;

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/XmwONYspHNUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



ScriptEngineManager

2012-06-14 Thread Jepse
Hi there,

I'm curious about the gwt behavior with ScriptEngineManager. Everytime it 
comes over this class it throws an error in development console. But it 
works fine - feels more like a warning in this case:
*No source code is available for type javax.script.ScriptEngineManager; did 
you forget to inherit a required module?*

But when i want to compile my projects the error is geeting:
*  [ERROR] at Field.java(271): ScriptEngineManager manager = new 
ScriptEngineManager();
 org.eclipse.jdt.internal.compiler.ast.LocalDeclaration*

What can i do?


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/9LGjMOMuwIcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.