incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Frederickx <>
Subject Re: Seperate thread on JSON and AJAX
Date Mon, 08 Mar 2010 20:33:48 GMT
Actually, the Stripes JavascriptResolution has already all the ingredients.
In only lacks the API to build a JSON object (avoiding the client
eval() ) as a complementary API to the cuurent build of the javascript

Maybe we can extend the stripes implementation ?


On Mon, Mar 8, 2010 at 6:18 PM, Janne Jalkanen <> wrote:
>>> I do not understand why a simple 'buildJSON' is not part of the API of
>>> their JavaScriptResolution class.
>> Good question. But it's not, so we will have to do something, then. :)
>> How hard can it be? Would it be as simple as the example you gave?
>> (Maybe just escape all of the single quotes in the three HTML
>> strings?)
> Writing a JSONResolution is really simple, BTW. Have done it for corporate purposes (so
can't cut-n-paste the code, unfortunately, and partly therefore would prefer if someone else
did it). The reason why Stripes does it the way it does is because this way it can marshal
e.g. circular references and other goodies. So it's a very generic system that works with
pretty much everything, and can be eval()ed nicely. However, doing eval() is generally discouraged
(it's a potential security hole) and therefore many JS libs are already using either the native
JSON parser or roll their own.
> /Janne

View raw message