상세 컨텐츠

본문 제목

jsp

1 a n G u a g e /JAVA

by 동혼 2019. 8. 6. 09:20

본문

 

 

 

 

_______________________________________________________________

meveResult (move의 오타 )

 

 

 

<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>







<%
String choice = request.getParameter("url");
/* 
if (choice.equals("네이버")){
response.sendRedirect("http://www.naver.com");
}
else if (choice.equals("다음")){
response.sendRedirect("http://www.daum.net");
}
else if (choice.equals("구글")){
response.sendRedirect("http://www.google.com");
} */

HashMap url_map= new HashMap();

url_map.put("네이버","http://www.naver.com");
url_map.put("다음","http://www.daum.net");
url_map.put("구글","http://www.google.com");

/*  String url = request.getParameter("url");
String result = url_map.get(url);
response.sendRedirect(result); */

response.sendRedirect(url_map.get(request.getParameter("url")));
%>

 

 

 

 


_______________________________________________________________

 

logincheck

 

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>






<% String id= "phh";
String pw ="1234";

String input_id= request.getParameter("id");
String input_pw= request.getParameter("pw");

if (id.equals(input_id) && pw.equals(input_pw)){
response.sendRedirect("loginSuccess.jsp");
}
else {

response.sendRedirect("login.jsp");
}
%>


 

 


_______________________________________________________________

 

moveURL

 

 

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>






meveResult.jsp">













 

 

 

 

 

 

 

 

'1 a n G u a g e > JAVA' 카테고리의 다른 글

web.xml 파일에 대해서  (0) 2020.04.07
[JSP] 2019.08.05.  (0) 2019.08.06
[Java] ArrayList 에서 데이터 찾기  (0) 2019.07.14
[Java] ArrayList 개념정리  (0) 2019.07.12
[Java] [알고리즘] 문제풀이 , 연습문제 풀이  (0) 2019.07.10

관련글 더보기

댓글 영역