Defect #823

Velocity plugin causing other Servoy clients in same thread to receive wrong datatypes

Added by Marc Boegem almost 9 years ago. Updated almost 9 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Browser (if web client):


As reported previously, the velocity plugin is still causing other Servoy clients in the same Java thread to receive wrong datatypes.
ie. javascript date vs.

In this particular situation, the velocity plugin has been used to serve an html5 application.
It will handle GET and POST requests and return a data object to the template in order to be rendered and returned to the browser.

functions used:
  • getVersion()
  • toJSON() > to get incoming headers and parameters to readable text and to convert a custom JS associative array(Object) to txt in order to store in DB
  • fromJSON() > to parse the latter JSON into an associative array again.
  • createCookie()
  • createErrorResponse()
  • createResponse() > this will return an object holding data and information on the template to be used.

Associated revisions

Revision 1146 (diff)
Added by Patrick Talbot almost 9 years ago

Fix for issue #823

Revision 1147 (diff)
Added by Patrick Talbot almost 9 years ago

Fix for issue #823 + better JSON serialization in Velocity response for non string objects.



Updated by Patrick Talbot almost 9 years ago

  • Status changed from New to In Progress

I've changed the way the wrapping of RecordWrapper operates, as well as the fromJSON() method, this should not touch the current ServoyWrapFactory of the Context.currentContext() yet still work fine for Servoy objects.
So v3.3.5 should fix your issue.
Please update and let me know about it.


Updated by Marc Boegem almost 9 years ago

This doesn't seem completely solved.
Results are way better, but datatypes seem to be altered after PUT requests to the server.
The situation:
- Freshly launched servoy server
- Start webclient, which will successfully run through the onOpenSolution method
- Do a PUT using query AJAX request
- Start web client again, now it receives a date in the wrong data type again.

example PUT request:
url: "../dienst.json",
data: $("#dienst-form-accept").serializeArray(),
type: "PUT",
error: function(){
alert("De server kon niet worden bereikt, herstart de app en probeer het opnieuw");
success: function(data) {
if(data.result.error) {
if(data.result.type 'error' || data.result.type 'fatal') {
$('#error-popupDialog a').hide();
if(data.result.msg) {
$('#error-popupDialog h3').html(data.result.msg);
} else {


Updated by Patrick Talbot almost 9 years ago

  • Status changed from In Progress to Closed

Fixed in v3.3.6

Also available in: Atom PDF