< %@page contentType="text/html; charset=euc-kr" %>
<%@page import="java.io.*" %>
<HTML><TITLE>홈페이지 메인</TITLE></HEAD>
<BODY>
<H3>저의 홈페이지에 오신 것을 환영합니다.</H3>
<H4>Welcome to my homepage</H4>
<type = button name = "게시판" >
<%!
public static void button1(javax.servlet.http.HttpServletResponse response)
{
response.sendRedirect("http://www.naver.com/");
}
%>
</BODY>
</HTML>
button1이라는 사용자 정의 함수 내에서 response라는 내장 변수를 사용하기 위해 이렇게 넘겨줬는데 객체니까 이렇게 넘겨줘도 상관없을텐데??
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 16 in the jsp file: /homepage.jsp
Unhandled exception type IOException
13: public static void button1(javax.servlet.http.HttpServletResponse response)
14: {
15:
16: response.sendRedirect("http://www.naver.com/");
17: }
18: %>
19:
이런 오류가 난다.
try catch 해라
아니 오류가 나는게 문제가 아니라 오류를 해결하려고 하는데
왜 오류가 나는건지 모르겠어서
try catch 안하니까 Unhandled exception type IOException 가 나잖아
아 그렇구나 땡큐