0

To log ing, get parameter rol and id user:

if (httpServletR.getSession().getAttribute("ush_id") != null) {
    ush_id = httpServletR.getSession().getAttribute("ush_id").toString();
    rol_id = Integer.parseInt(httpServletR.getSession().getAttribute("rol_id").toString());
    logger.info("Rol: "+rol_id);
    Rol rl=new Rol();
    rl.setRol_id(rol_id);
}

But I do not know how to save in session and retrieve a bean. Now I get it back in this way, but I have many problems, because once in a while keeps the variable from a previous session.

public class solicitud {
    public void listarSolicitud() throws Exception {
        adminBean adm = new adminBean();
        int usu = Integer.parseInt(adm.getUsu_id());

Or exists another solution to avoid these problems?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

1

another Bean add this code:

rol_id = Integer.parseInt(httpServletR.getSession().getAttribute("rol_id").toString());

It works perfectly