Java - Problem receiving input text with this format "% 22USERMEX% 22="

-1

I have this problem in Java, that when I receive an input text from the form to validate in a stored procedure, the value of the data gives it to me enclosed between "% 22" and "% 22=" and I do not know how to remove this, since with this aggregate the search does not match. I do not know if I have to see that I use a support class like EasyUI ... When debugging the field tells me that it has the value of "% 22USERMEX% 22=" when it should be only "USERMEX" ... does anyone know what's going on?

    
asked by Bluna 13.08.2018 в 17:31
source

1 answer

0

I found the detail, originally the script is like this:

function checkExistEmpleado(valor) {
    $.ajax({
                type : "POST",
                url : "checkExistEmpleado",
                cache : false,
                data: valor,
                dataType: 'text',
                context : document.body,
                success: function(data) {...etc

But I sent the value with percentage (% 22) and with a sign of "=", then I modified the javascript and it stayed like this:

function checkExistEmpleado(valor) {
    $.ajax({
                type : "POST",
                url : "checkExistEmpleado",
                cache : false,
                data: JSON.stringify(valor),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                context : document.body,
                success: function(data) {...etc

And finally I send the value as it should be.

It was not so much about Java, but how it sent the value by ajax.

I appreciate the help very much, it led me to the idea of where the problem might be.

    
answered by 13.08.2018 / 18:14
source