a태그 href나 location.href나 해당하는 값일 경우에 지정한 페이지로 이동한다는 소리인데


<li class="active"><a href="main.jsp">메인</a></li>

이 경우는 해당하는 메인이라는 단어를 클릭하면 메인 페이지로 이동하는 거고


if(userID != null){

PrintWriter script = response.getWriter();

script.println("<script>");

script.println("alert('이미 로그인 되었습니다.')");

script.println("location.href = 'main.jsp'");

script.println("</script>");

}

이거는 함수 사용해서 값 비교를 통해 실행되는 거니까 그 차이인가요?