Through javascript I have created a function to put information in a text box. I have written the special characters and I want to introduce the ñ / Ñ and the accents. By filling in that text box and giving the save button gives the error Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986, in my tomcat with version 7.0.78. I have looked at many sites, and commented something about changing catalina.properties
and server.xml
, I have modified them and still giving the same error, in the bbdd that is from Oracle I have also modified the encoding to UTF-8 so that it admits all the characters but the Tomcat does not take them. Let's see if someone can give me a hand because I do not know what else to look for.
In the file of catalina.properties I added this line
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
and in the server.xml I added
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/> la parte URIEncoding.
Thanks in advance. Greetings !!
The servlets that do the operation use the doPost method, I do not know if you mean that. I've been keeping an eye on those methods, is it valid for any browser? Since the application at the moment is only used in IE. And another question, if I already have my code made to call the function that handles the characters that can be entered, these functions where should I implement them?
function check() {
// Patron de entrada
patron1 = /[^a-zA-Z 0-9.]+/g,' '; // mayúsculas, minúsculas, números y espacio
patron2 = /^[a-zA-ZáéíóúÁÉÍÓÚ]*$/; // acentos
patron = patron1 + patron2;
tecla_final = String.fromCharCode(tecla);
return patron.test(tecla_final);
}
This is the function to enter the characters that are indicated.