@특정 값을 보내는 방법1 redirectEncodingTest.jsp
----------------------------------------------------------------<%@page import="java.net.URLEncoder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String value="자바abcD";
String encodedValue=URLEncoder.encode(value,"UTF-8");
response.sendRedirect("../study_jsp/redirectEncodingTest_sub.jsp? name="+encodedValue);
%>
</script>
</body>
</html>
================================================================
@특정 값을 보내는 방법 1-1 redirectEncodingTest_sub.jsp
----------------------------------------------------------------
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%= request.getParameter("name") %>
</body>
</html>
================================================================
'개발 > jsp' 카테고리의 다른 글
jstl 함수 사용 방법 (0) | 2015.10.08 |
---|---|
jstl 변수 선언 (0) | 2015.10.08 |
jsp 게시판 만들기 1 (0) | 2015.09.30 |
jsp 달력만들기 (0) | 2015.09.25 |
jsp URLEncoder (0) | 2015.09.25 |
댓글