NewFile1.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>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js">
</script>
<script src="http://malsup.github.io/jquery.blockUI.js"></script>
<script>
$(document).ready(function(){
$.ajax({
url:'NewFile2.jsp',
beforeSend:function(){
//alert("beforeSend");
$.blockUI();
},
success:function(data){
//alert("success");
alert(data);
},
error:function(xhr,textStatus,errorThrown){
alert("error:"+xhr+":"+textStatus+":"+errorThrown);
},
complete:function(xhr,textStatus){
//alert("complete");
$.unblockUI();
}
});
});
</script>
</head>
<body>
<input type="text">
</body>
</html>
NewFile2.jsp
============
<%@page import="kr.co.seoulit.member.dao.MemberDAOImpl"%>
<%@page import="kr.co.seoulit.member.to.MemberBean"%>
<%@page import="kr.co.seoulit.member.dao.MemberDAO"%>
<%@page import="java.lang.reflect.Member"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@ page import="net.sf.json.JSONObject"%>
<%@ page import="java.util.*" %>
<%
try{Thread.sleep(3000);}catch(Exception e){ }
List<MemberBean> list=MemberDAOImpl.getInstance().selectMemberList();
HashMap<String,Object> map=new HashMap<String,Object>();
map.put("list",list);
map.put("newrow",new MemberBean());
JSONObject jsonObject=JSONObject.fromObject(map);
out.println(jsonObject);
%>
'개발하자 > JSP&Servlet' 카테고리의 다른 글
태그만들어 사용하기 예제 (0) | 2015.03.31 |
---|---|
태그파일 사용하기,속성값 전달 (0) | 2015.03.31 |
jQuery BlockUI Plugin (0) | 2015.03.28 |
annotation (0) | 2015.03.28 |
Target,Retention xml파일에 FileOutputStream이용하여 내용넣기 (0) | 2015.03.28 |