I am using AJAX to save a name value. This is my JS code in the JSP file:
In my servlet I simply extract the parameters and use them:
This works fine until user gives name like 'This & That' (anything that has an '&'). When this happens the servlet gets only the string before & (eg. 'This ')
This is happening because it thinks that there is another parameter due to occurrence of &.
Using & doesn't work too, because & comes there also.
Can someone please suggest how can I work around this?