servlet: make rules stringify the same as in js