본문 바로가기

기존카테고리/Java & jsp Tip

asp Response.end 또는 php의 exit;와 같은 jsp의 if(true) return;


실행 중 중단할 경우:

if(true) return; 를 삽입한다.






<%@ page import="kr.co.on2.ex.MemberDto" %>

<%@ page import="kr.co.on2.ex.MemberDao" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>



<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

<script src="/on2/js/members.js" ></script>

</head>

<body>

<%

if(session.getAttribute("ValidMember")==null){

%>

<script>

alert('로그인 후 사용하세요.');

location.href="login.jsp";

</script>

<%

if(true) return; // 실행 중단

}

String ValidMember = (String)session.getAttribute("ValidMember");

out.println("ValidMember:"+ValidMember);




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

MemberDao dao = MemberDao.getInstance();

MemberDto dto = dao.getMember(id);

%>

<form action="joinOk.jsp" method="post" name="reg_frm">

아이디 : <input type="text" name="id" size="20" value="<%=dto.getId()%>"><br />

비밀번호 : <input type="password" name="pw" size="20"><br />

비밀번호 확인 : <input type="password" name="pw_check" size="20"><br />

이름 : <input type="text" name="name" size="20" value="<%=dto.getName()%>"><br />

메일 : <input type="text" name="email" size="20" value="<%=dto.getEmail()%>"><br />

주소 : <input type="text" name="address" size="50" value="<%=dto.getAddress()%>"><br />

<input type="button" value="수정" onclick="updateInfoConfirm()">&nbsp;&nbsp;&nbsp; 

<input type="reset" value="취소" onclick="javascript:window.location='login.jsp'">

</form>

<%

%>

</body>

</html>