WebStudy 썸네일형 리스트형 DB싱글톤 방식, ConnectionPool private static DbDao instance = new DbDao(); public static DbDao getInstance(){ return instance; } private DbDao(){ try { Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@localhost:1521:xe"; con = DriverManager.getConnection(url, "hr", "1234"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } 커넥션 풀 ---------------------- 3개의 파일을.. 더보기 session 에 관한 ... session 은 jsp가 서버에 접속하면서 servlet으로 변환될때 나동으로 하나가 생성이 된다. 그래서jsp파일에 session.isNew()를 하면 처음 생성될때는 true가 나오지만 한번 서버에 접속 후 새로 고침을 하게 되면 서버에 다녀온 후 session 이 생성되어있기 때문에 false가 나오는 것이다. 더보기 jqeury servelt ajax $(function(){ $('#ajaxBtn').click(function(){ $.ajax({ type : "POST", url : "test.qr", async : true, dataType : "html", data:{ ajaxValue:"한글", ajaxValue2:"20" }, success : function(data){ alert(decodeURIComponent(data)); }, error : function(xhr){ alert("error html = " + xhr.statusText) } }); }); }); ------------------servlet---------------------------- req.setCharacterEncoding("utf-8"); String v.. 더보기 비동기 통신 JSON function createRequest(){ if(window.XMLHttpRequest){ //win 7이상 , 크롬 등등 request = new XMLHttpRequest(); } else if(window.ActiveXObject){ //win 7미만 request = new ActiveXObject("Microsoft.XMLHTTP"); } return request; } function ajax(){ //가장먼저 request객체를 얻어와야함. request = createRequest(); if(request == null) alert("Unable to create request"); else { //servlet주소를 쏴준다. Project Name var url = "test.json.. 더보기 비동기 통신, AJAX - javascript 화면은 그대로 있고 서버에서 데이터만 가져와서 작업을 하는 것. 기술 ajax가 개발된 이유 서버에 부하를 줄이기 위해서. 전체 페이지가 아닌 페이지의 일부분 데이터를 로딩. --------------java script --------------------------------- function createRequest(){ if(window.XMLHttpRequest){ //win 7이상 , 크롬 등등 request = new XMLHttpRequest(); } else if(window.ActiveXObject){ //win 7미만 request = new ActiveXObject("Microsoft.XMLHTTP"); } return request; } function ajax(){ //가장먼저 .. 더보기 이전 1 2 3 4 5 6 7 ··· 11 다음