On Jan 12, 2010, at 5:06 PM, Robert Koberg wrote:
>
> On Jan 12, 2010, at 7:35 AM, Paul Sandoz wrote:
>
>>
>> On Jan 12, 2010, at 4:23 PM, Robert Koberg wrote:
>>
>>> Hi,
>>>
>>>
>>> You could use Rhino on the server and reuse any appropriate
>>> javascript (including GWT generated JS), but you would need a
>>> mapping script that gives the browser environment. For example: http://ejohn.org/blog/bringing-the-browser-to-the-server/
>>>
>>> But, perhaps you want to skip the java to js step for the server
>>> side and just use java on the server?
>>>
>>> javascript page building = DOM manipulation and/or string
>>> concatenation: Fine for building pages in the browser on the
>>> client, but not on the server. But, perhaps enough for some needs
>>> and does make things simple.
>>>
>>> How do you see Jackson working in this scenario?
>>>
>>
>> Off the top of my head, use a Jackson/GWT plug-in to compile the
>> JSON model Java classes to JavaScript.
>
>
> Isn't this what GWT does?
Yes, but it does it's own thing in terms of communication between the
client and server that requires both sides use GWT. But, GWT is
extensible so one can include plugins for compilation.
> Or are you talking about using jackson to create something like a
> JSON Schema (http://json-schema.org/ )? Or are you talking about
> creating javascript object instances at runtime using Jackson?
> Either way you will still need a javascript implementation to run it
> (i.e. a current Rhino or the older JDK version of it)
>
We are just referring to the client side for JavaScript. The server
side can remain in Java classes. The point here is to allow the use of
JAX-RS/Jersey with the client-side being GWT.
> Why limit to GWT? It sounds like you need a plain old javascript
> object. I am not familiar with GWT, so maybe I am missing something?
> Maybe it handles typing information in a useful way?
>
GWT allows one to code in one language, Java, so one does not need to
know JavaScript. GWT will only compile the relevant Java artifacts for
client-side processing to JavaScript.
Paul.