0
//retorna o usuário logado no sistema
public class ContextObject {
public static Usuario getUsuario() {
ContextObject contextObject = ContextFactory.getContextObject();
return contextObject.usuario;
}
}
//mostra em uma função alert() o usuário logado
<script> alert(ContextObject.getUsuario()); </script>
Since these two codes are in different files.
I’m doing this but it’s not right, how should I do it? I need to take the return of java code and show what is coming in the function alert
javascript.
If the javascript code is executed on the client side and the java code is on the server side, it seems to me a difficult task to perform. In this case AJAX may be a solution to this problem.
– Rui Lima