2016-06-24 5 views
0

에서 세션에 저장합니다역할과 사용자 ID를 가져 오기 및 매개 변수 ROL 및 ID 사용자를 보내고 로그 얻기 위해 JSF 2

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); 
} 

하지만 세션에서 저장하는 방법을 알고 빈을 검색하지 않습니다. 이제는 이런 식으로 되돌려 놓았 습니다만, 한동안 변수를 이전 세션에서 유지하기 때문에 많은 문제가 있습니다.

이러한 문제를 방지하려면 다른 해결책이 있습니까?

다른 콩이 코드를 추가

답변

1

: 그것은 완벽

작동

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