2
It is possible get a javascript value and put inside a java variable.
EX:
var len = $(" #relacaoPax select[name=tipo] ").length;
console.log( "len = " + len );
});
<% int l = len;
System.out.println( "//L = " + l );
%>
2
It is possible get a javascript value and put inside a java variable.
EX:
var len = $(" #relacaoPax select[name=tipo] ").length;
console.log( "len = " + len );
});
<% int l = len;
System.out.println( "//L = " + l );
%>
1
You would need to use AJAX on your page.
If you’re using JSF, take a look at the tag f:ajax
.(http://uaihebert.com/jsf-exemplos-simples-com-ajax/)
JSP + Servlet: http://www.klebermota.eti.br/2013/10/23/ajax-com-jsp-e-servlet-usando-jquery/
1
It is not possible to do what you want because all the JAVA code of your page is processed on the server and when you get to the browser there will only be HTML and JAVASCRIPT code to be interpreted.
Okay, thanks, I’ll try other ways.
Browser other questions tagged javascript java html html5
You are not signed in. Login or sign up in order to post.
You need AJAX, which is already a saturated subject. Some references: http://answall.com/questions/15028/popup-com-ajax-e-jquery/15081#15081 and http://answall.com/questions/22446/chamar-m%C3%A9todo-java-no-javascript/22464#22464
– Guilherme Oderdenge
Then not possible, would have to have a servletto treat that the request of ajax.
– Fabio Macedo
That’s right, Fabio. :-)
– Guilherme Oderdenge
Hello.... da uma pesquisa no motor "Nashorn" eh uma forma de intreragir o JAVA com Javascript ... ou seu Javascript com o seu Unix .... muito legal.
– user14100