Error with FacesContext.getCurrentInstance (). getExternalContext (). getSessionMap ()

0

Hello friends of the community.

I am very new and I have a doubt.

Inside a Servlet I have a message that I have to receive in a Java Class Controller to display it visually. From the servlet I send it with the following code:

FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("mensajeSession", mensaje);

And in the control where I need to receive the message I do so:

String mensajeError = (String) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("mensajeSession");

The error occurs in the first attempt, when the action that arrives at the Servlet is executed and does these two steps, the session arrives in Null, but in the next execution, it works correctly, as if it were the variable It is lost in the first attempt.

I hope your help, please. I would appreciate it very much.

    
asked by Camilo Gutiérrez Castrillon 06.07.2018 в 23:41
source

0 answers