게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
jsp 질문 있어요
게시물ID : programmer_11467짧은주소 복사하기
작성자 : uithing
추천 : 0
조회수 : 331회
댓글수 : 4개
등록시간 : 2015/06/21 09:18:57
옵션
  • 본인삭제금지
<% 
request.setCharacterEncoding("UTF-8"); 
String id = (String) session.getAttribute("id");
String sname = (String) session.getAttribute("sname");
String weight = (String) session.getAttribute("weight");
String pw = (String) session.getAttribute("pw");
String height = (String) session.getAttribute("height");
String age = (String) session.getAttribute("age");
if(id==null && sname==null){
response.sendRedirect("loginpage.jsp"); 
}
int w = Integer.parseInt(weight);
int h = Integer.parseInt(height);
%>

위코드 진행시

세션 불러오고 null확인시 loginpage.jsp로 돌아가도록 하는것이 목적입니다.

int w = Integer.parseInt(weight);
int h = Integer.parseInt(height);

두줄을 사용하지 않거나 세션에 값이 들어간 상태에서는 오류가 나지 않는데

사용하거나 세션값이 없는 상태에서는

org.apache.jasper.JasperException: An exception occurred processing JSP page /03/excpage/pi.jsp at line 14
(14번째 줄은 int w = Integer.parseInt(weight);)
 
오류가 뜨게 됩니다.

int w = Integer.parseInt(weight);
int h = Integer.parseInt(height);

사용에 있어서 어떤부분이 오류를 나게 하는건가요?
아래는 오류 페이지 스샷입니다.

exceerr.JPG


꼬릿말 보기
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호