본문 바로가기

IT프로그래밍

jsp session 속성 / jsp session 설명 / jsp 세션 속성




 메소드

성 

Object getAttribute(String name)

 name에 해당되는 객체 값 반환,Object값이 오르모, 반드시 받을 때 형 변환

ex) String my_id = (String)session.getAttribute("id");

 Enumeration getAttributeNames()

세션의 모든 객체이름 반환 

 long getCreationTime()

세션이 만들어진 시간 반환 

String getId() 

해당 세션의 고유 id값 반환 

long getLastAccessedTime() 

클라이언트가 마지막으로 요청한 시간 반환 

int getMaxInactiveInterval() 

요청을 하지 않았을 때, 세션을 유지할 최대 시간(요청이 들어오면 다시 0부터 그 시간까지)

boolean isNew() 

해당 세션이 처음 생성된것이라면 true, 전에 있던거면 false 

void removeAttribute(String name) 

지정된 name의 객체 세션에서 제거 

void setAttribute(String name, Object value) 

세션에 지정된 이름 객체 추가

 void setMaxInactiveInterval(int interval)

요청이 안들어왔을 때 세션을 유지할 시간 설정(초 단위) 

void  invalidate()

세션 destroy