목록분류 전체보기 (20)
자기 혐오 개발자
첨부파일, 특히 에디터를 사용해서 올린 파일들의 순서를 바꾸려고 할때, 드래그 해서 바꿀 수 있다.jquery의 sortable을 사용한다. 옵션중에 stop,start,update 등등 이 있다. 구글하면 더 나옴. HTML단 .....
jQuery 단. $(document).ready(function(){ $('input[type=radio][name=이름]').change(function(){ // 함수 호출. fn_radio_call(); });}); // 함수...function fn_radio_call(){var test_val = $(":input:radio[name=이름]:checked").val(); $.ajax({ type: "POST", url: "${pageContext.request.contextPath}/testService", data: {"test_val":test_val}, dataType: 'json', success: function (data) { if (data.result > 0) { location..
pom.xml에 추가. cglibcglib2.2.2 applicationContext.xml에 추가해준다. servlet-context.xml 에서는 Class단에서 Service의 impl에는package kr.test.service.impl; @Servicepublic class TestServiceImpl implements TestService {... @Overridepublic int insertHpTest(HpTestVO vo) throws Exception {int result = 0;try { long time = System.currentTimeMillis(); SimpleDateFormat dayTime = new SimpleDateFormat("yyyyMMddHHmmss"); log..
pom.xml에서 org.apache.velocity velocity 1.7 org.apache.velocity velocity-tools 2.0 Java단에서는 VelocityEngine velocityEngine = new VelocityEngine(); // 이 부분이 중요하다.. velocityEngine.setApplicationAttribute("javax.servlet.ServletContext", request.getSession().getServletContext()); Properties properties = new Properties(); properties.setProperty("resource.loader", "webapp"); properties.setProperty("weba..
프로젝트 하는 중에 광고와 연계하는 과제가 있었다.10ping이라는 광고 에이전시의 API를 사용해서, 광고하는 앱의 안드로이드 package 명을 가져오는 것이었다. 처음에는 iframe으로 해서 가져올려고 했더니, Denied Access가 발생. 크로스 도메인 문제인가 해서, 결국 자바 서버단에서 구현하기로 했다. 열심히 구글링을 했고, stackoverflow에서 해답을 얻었다. // url 주소를 받아와서. 연결 시킨 후 리디렉션 된 url을 받아온다.String url = String.valueOf(req.getParameter("url"));URLConnection con = new URL(url).openConnection(); URL redirectUrl = getFinalURL(con...
pom.xml에서 org.apache.velocity velocity 1.7 org.apache.velocity velocity-tools 2.0 Java단에서는 VelocityEngine velocityEngine = new VelocityEngine(); // 이 부분이 중요하다.. velocityEngine.setApplicationAttribute("javax.servlet.ServletContext", request.getSession().getServletContext()); Properties properties = new Properties(); properties.setProperty("resource.loader", "webapp"); properties.setProperty("weba..
굵은 글자는 Properties에 정의하고 가져온다. // 메일 전송시 사용. Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", MAIL_SMTP_SERVER); // 서버주소. ex)smtp.머머머.com props.put("mail.smtp.port", MAIL_SMTP_PORT); // 포트 번호. props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.ssl.trust", MAIL_SMTP_SERVER); props..
MySQL에서 구글에서 찾은 방법인 (@rownum:=@rownum+1) AS ROW_NUM를 써서, Rownum를 구하려 했으나, 계속 중복되는 rownum가 있었다. ROWNUM1222...쿼리를 찬찬히 들여다 보니.기본쿼리 : SELECT T1.* FROM ( SELECT (@rownum:=@rownum+1) AS ROW_NUM , A.* , FN_펑션(A.값1) AS SAVE_DIR FROM 테이블 A , (SELECT @rownum:=0) B ) WHERE 1 = 1 ORDER BY 등록일 DESC ) T1WHERE 1 = 1 저 Function이 문제인가 싶어서 고쳐봤다. 수정 후 쿼리 :SELECT T1.* , FN_펑션(T1.값1) AS SAVE_DIR FROM ( SELECT (@rown..
스크립트 단// 숫자만 입력. function isNumberKey(evt){ var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); }else{ theEvent.returnValue = true; } } HTML
팝업을 띄웠는데, session이 끊겨서 로그인 창이 나오는 홈페이지가 종종 보인다. 내가 만든 사이트에서도 이런 일이 생겨서 우짜꼬 하다가로그인 창에서 이 창이 부모창인지 자식창인지 구분해가, 어떤 조치를 취하면 되지않을까 해서 구분하는 코드를 찾아봤다.Google하니 나오더라.http://stackoverflow.com/questions/4594492/to-check-parent-window-is-iframe-or-not 우선 두 개를 찾았다. if(self==top){ alert('self==top'); }else if(parent==top){ alert('parent==top'); } 'self==top' 는 팝업이 아닌, 일반창에서 열린 경우고,'parent==top는 팝업이다. var isIn..