I have the following situation.
I get a string that is in the ApplicationStorage location in a javascript variable.
<script>
var sendForm = localStorage.getItem('f');
</script>
This same string I pass to a java variable to perform the necessary procedures that I will need.
<%
String id_formulario = "";
id_formulario = "<script>document.write(sendForm)</script>";
%>
To perform tests I show this string with a
<%
out.print(id_formulario);
%>
And that's okay! it is the exact string that was in the localStorage, however when I try to compare it with any string EQUAL the java does not recognize that they are equal and simply ignores.
<%
if(id_formulario.equals("QUALQUERVALOR")){
out.print("É igual!!!");
}
%>
Why is this happening? I've tried everything and I can not solve this problem !!