'프로그래밍 > Android' 카테고리의 다른 글
[Hello,Android] 익명의 내부 클래스 (0) | 2010.08.17 |
---|---|
[Hello,Android] WebView 사용 시 (1) | 2010.08.16 |
[Hello,Android] 기본팁 (0) | 2010.06.08 |
[Hello,Android] Activity Lifecycle (0) | 2010.06.07 |
[설치] Android 개발 환경 설정하기 (0) | 2010.04.21 |
[Hello,Android] 익명의 내부 클래스 (0) | 2010.08.17 |
---|---|
[Hello,Android] WebView 사용 시 (1) | 2010.08.16 |
[Hello,Android] 기본팁 (0) | 2010.06.08 |
[Hello,Android] Activity Lifecycle (0) | 2010.06.07 |
[설치] Android 개발 환경 설정하기 (0) | 2010.04.21 |
[Hello,Android] 익명의 내부 클래스 (0) | 2010.08.17 |
---|---|
[Hello,Android] WebView 사용 시 (1) | 2010.08.16 |
[Hello,Android] 기본팁 (0) | 2010.06.08 |
[Hello,Android] Activity Lifecycle (0) | 2010.06.07 |
[설치] Hello, World! (0) | 2010.05.11 |
[인증서] javax.net.ssl.SSLHandshakeException (1) | 2010.10.15 |
---|---|
[unix] find 명령어 사용하기 (0) | 2010.02.08 |
[Makefile] Makefile 소개(An Introduction to Makefiles) (0) | 2009.10.23 |
[Shell Script] Shell Script 문법 (0) | 2009.10.14 |
[Shell Script] PATH추가 (0) | 2009.10.14 |
public void testJson() { try { JSONStringer test1 = new JSONStringer(); test1 .object() .key("key") .value("value") .endObject(); System.out.println(test1.toString()); JSONStringer test2 = new JSONStringer(); test2 .array() // array 시작 [ .object() // object 시작 { .key("key") .value("value") .key("key2") .value("value2") .endObject() // object 끝 } .object() .key("2key") .value("2value") .endObject() .endArray(); // array 끝 ] System.out.println(test2.toString()); } catch(Exception e) { e.printStackTrace(); } } |
{"key":"value"} [{"key":"value","key2":"value2"},{"2key":"2value"}] |
[XML] The processing instruction target matching "[xX][mM][lL]" is not allowed (0) | 2010.10.14 |
---|---|
[jdom] jdom을 이용한 XML 문서 생성하기 (0) | 2010.09.03 |
[XPath] StringReader를 이용한 InputSource 를 소스로 해서, XPath.evaluate() 시 에러 (0) | 2009.03.03 |
[XPath] String으로 InputSource 생성하기 (0) | 2009.03.02 |
[에러] javax.xml.xpath.XPathFactory 사용 시, newInstance() 생성이 안될 때 (0) | 2009.03.02 |
<head>
<link rel="SHORTCUT ICON" href="http://www.mydomain.com/myicon.ico"/>
<title>My Title</title>
</head>
[script] 소수점 자리수 (0) | 2010.05.20 |
---|---|
[html] IE6.0/7.0 에서 setAttribute로 css 설정 안되는 경우 (0) | 2010.05.11 |
[html] X-UA-Compatible: IE=EmulateIE7 (0) | 2010.04.09 |
[javascript] 전화번호 형식으로 바꾸기 (0) | 2010.03.08 |
[javascript] DOM 스크립트 (0) | 2010.01.15 |
[SQLite] Quick Start (1) | 2010.05.24 |
---|---|
[oracle] 쿼리 결과를 파일로 출력하기 (0) | 2010.05.20 |
[oracle] select 문을 이용한 update (0) | 2010.03.08 |
[oracle] 제약조건 확인하기 (0) | 2010.02.25 |
[Toad] tab 간격 조정하기 (0) | 2010.02.02 |
HTTP/1.1 200 OK Date: Fri, 09 Apr 2010 06:58:34 GMT Server: Apache Content-Length: 6990 X-UA-Compatible: IE=EmulateIE7 P3P: CP='ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI' Keep-Alive: timeout=10, max=2000 Connection: Keep-Alive Content-Type: text/html;charset=UTF-8 |
Windows Internet Explorer 7에서 올바르게 동작하는 기존 웹 페이지를 유지 관리하고 있으며, 최소한의 수정만으로 Windows Internet Explorer 8에서 동작하도록 이 웹 페이지를 업데이트해야 하는 경우 다음 헤더를 보내도록 서버를 구성합니다.
|
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=8"/> |
[html] IE6.0/7.0 에서 setAttribute로 css 설정 안되는 경우 (0) | 2010.05.11 |
---|---|
[html] shortcut icon 붙이기 (0) | 2010.04.15 |
[javascript] 전화번호 형식으로 바꾸기 (0) | 2010.03.08 |
[javascript] DOM 스크립트 (0) | 2010.01.15 |
[jstl] jstl 사용하기 (0) | 2010.01.08 |
[ftp] FTP/SFTP/FTPS 의 차이점 (0) | 2010.10.18 |
---|---|
[eclipse] plug-ins (0) | 2010.08.17 |
[program] 프로파일러 (0) | 2009.12.03 |
[Eclipse] Aptana Studio (0) | 2009.11.30 |
[Eclipse] 형상관리 plug-in (0) | 2009.11.30 |
[java] 이미지 리사이즈 (0) | 2010.07.23 |
---|---|
[java] 소수점 자리수 / 천단위 콤마 (0) | 2010.05.18 |
[java] invoke (0) | 2010.03.09 |
[java] getClass, getMethod, invoke (0) | 2010.01.22 |
[java] Pattern / Matcher (0) | 2010.01.22 |
[java] 소수점 자리수 / 천단위 콤마 (0) | 2010.05.18 |
---|---|
[java] Convert Milliseconds to Date (0) | 2010.03.15 |
[java] getClass, getMethod, invoke (0) | 2010.01.22 |
[java] Pattern / Matcher (0) | 2010.01.22 |
[java] 파일 관련 (0) | 2010.01.07 |
[html] shortcut icon 붙이기 (0) | 2010.04.15 |
---|---|
[html] X-UA-Compatible: IE=EmulateIE7 (0) | 2010.04.09 |
[javascript] DOM 스크립트 (0) | 2010.01.15 |
[jstl] jstl 사용하기 (0) | 2010.01.08 |
[jsp] jstl 설명 (0) | 2010.01.08 |
[oracle] 쿼리 결과를 파일로 출력하기 (0) | 2010.05.20 |
---|---|
[oracle] ' 포함한 쿼리 (0) | 2010.04.09 |
[oracle] 제약조건 확인하기 (0) | 2010.02.25 |
[Toad] tab 간격 조정하기 (0) | 2010.02.02 |
[ORACLE] 특수문자 입력 (0) | 2009.10.21 |
[struts2] 스트럿츠1 과 2의 차이점 (0) | 2010.10.27 |
---|---|
[struts2] <s:if> 사용법2 (0) | 2010.08.04 |
[Strust2] 가이드 문서, 레퍼런스 문서 (0) | 2009.07.30 |
[Struts2] 스트러츠2태그에 기본값 설정하기 (0) | 2009.07.30 |
[Strust2] <s:radio> 사용법 (1) | 2009.07.29 |
[oracle] ' 포함한 쿼리 (0) | 2010.04.09 |
---|---|
[oracle] select 문을 이용한 update (0) | 2010.03.08 |
[Toad] tab 간격 조정하기 (0) | 2010.02.02 |
[ORACLE] 특수문자 입력 (0) | 2009.10.21 |
[Oracle] Toad 단축키 (0) | 2009.08.22 |
[인증서] javax.net.ssl.SSLHandshakeException (1) | 2010.10.15 |
---|---|
[unix] ftp 사용법 (0) | 2010.04.21 |
[Makefile] Makefile 소개(An Introduction to Makefiles) (0) | 2009.10.23 |
[Shell Script] Shell Script 문법 (0) | 2009.10.14 |
[Shell Script] PATH추가 (0) | 2009.10.14 |
[oracle] select 문을 이용한 update (0) | 2010.03.08 |
---|---|
[oracle] 제약조건 확인하기 (0) | 2010.02.25 |
[ORACLE] 특수문자 입력 (0) | 2009.10.21 |
[Oracle] Toad 단축키 (0) | 2009.08.22 |
[oracle10g] 페이징 시 rownum 사용하기 (0) | 2009.04.06 |
public static void setAllowedTypes(FileUploadInfo info, SubContentInfo sinfo) throws ContentException { log.debug("<< setAllowedTypes >> START"); Class cls = info.getClass(); Class scls = sinfo.getClass(); Method[] mtd = cls.getDeclaredMethods(); // cls에 선언된 모든 메소드를 반환 Pattern p = Pattern.compile("get_fileUpload_(\\d+)FileName"); // 패턴 설정. \d+ 는 정수 하나 이상(정규식) Matcher m = null; String mStr = null; String mType = null; String defExt = null; int i; for(i = 0; i < mtd.length; i++) { // 모든 메소드만큼 돌면서 m = p.matcher(mtd[i].getName()); // 메소드명과 패턴을 비교 if(m.find()) { // 매칭된 것이 발견되면 try { // group으로 매칭된 내용(메소드명)을 받아서 그 메소드를 실행. 파일명을 얻음. mStr = FileUploadInfo.getValueOfMethod(info, m.group()); if(mStr != null) { // 파일명이 존재하는 경우만 // group(1)으로 매칭된 번호를 얻어서 메소드 실행. 콘텐트 타입을 얻음. mType = FileUploadInfo.getValueOfMethod(info, "get_fileUpload_" + m.group(1) + "ContentType"); // 기본 확장자 지정 defExt = ""; if(mType != null) { defExt = mStr.substring(mStr.lastIndexOf(".") + 1); defExt = defExt.toLowerCase().trim(); log.debug("defExt = " + defExt); if("jpg".equals(defExt) || "gif".equals(defExt) || "xml".equals(defExt) || "xmp".equals(defExt) || "png".equals(defExt) || "zip".equals(defExt) ) { // 진행 }else { // 오류 발생 throw new ContentException("지원하지 않는 파일입니다."); } } Class[] cParam = new Class[]{String.class}; // 메소드를 찾는데, 메소드명이 "set...."이고 cParam형식을 파라미터로 갖는 메소드를 반환. null이면 파라미터 없는 메소드 // cParam이 Class 배열인 것은 파라미터가 여럿인 메소드가 있기 때문에. // 여기서는 String을 파라미터로 갖는 set_fileUp.... 메소드를 반환. Method cMtd = cls.getMethod("set_fileUpload_" + m.group(1) + "FileName", cParam); Object[] oParam = new Object[]{mStr}; // FileUploadInfo에 등록 cMtd.invoke(info, oParam); // info의 set_fileUpload_XFileName 메소드를 실행. 파라미터는 oParam // SubContentInfo에 등록 // 1. FileUPloadInfo의 FieldName을 찾는다. cMtd = cls.getMethod("get_fileUpload_" + m.group(1) + "FieldName", null); String tmpFieldName = (String)cMtd.invoke(info, null); // 업로드 파일명을 저장할 대상 필드명을 얻어서 // 2. SubContentInfo의 의 1번의 Method에 등록한다. cMtd = scls.getMethod("set" + tmpFieldName.substring(0, 1).toUpperCase() + tmpFieldName.substring(1) , cParam); cMtd.invoke(sinfo, oParam); // 서브콘텐츠info에 저장함. } } catch (ContentException e) { log.debug("지원하지 않는 파일 예외 발생", e); throw e; } catch (Exception e) { e.printStackTrace(); } } } } public static String getValueOfMethod(Object obj, String methodName) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { String str = ""; Class cls = obj.getClass(); Method mtd = cls.getMethod(methodName, null); // 넘겨받은 오브젝트의 클래스의 메소드를 얻어서 str = (String)mtd.invoke(obj, null); // 메소드를 실행시킴. // 이때 파라미터로 받은 오브젝트는 메소드가 실행될 대상 오브젝트. 즉, obj의 메소드 mtd를 실행함. return str; } |
[java] Convert Milliseconds to Date (0) | 2010.03.15 |
---|---|
[java] invoke (0) | 2010.03.09 |
[java] Pattern / Matcher (0) | 2010.01.22 |
[java] 파일 관련 (0) | 2010.01.07 |
[java] thorws ..... (0) | 2009.12.11 |
public class MatcherTest { /** */ @Test public void testMatcher() { //Method[] mtd = cls.getDeclaredMethods(); // cls에 선언된 모든 메소드를 반환 String mtd = "get_fileUpload_0FileName"; Pattern p = Pattern.compile("get_fileUpload_(\\d+)(FileName)"); // 패턴 설정. \d+ 는 정수 하나 이상(정규식) Matcher m = null; m = p.matcher(mtd); if(m.find()) { System.out.println(m.group()); // matcher에서 매칭된 것 전체를 반환 System.out.println(m.group(0)); // group() 과 같음. System.out.println(m.group(1)); // matcher에서 매칭된 것 중, pattern에서 첫 번째 ()로 묶인 것을 반환. 결과는 "0" System.out.println(m.group(2)); // matcher에서 매칭된 것 중, pattern에서 첫 번째 ()로 묶인 것을 반환. 결과는 "FileName" } } } |
[java] invoke (0) | 2010.03.09 |
---|---|
[java] getClass, getMethod, invoke (0) | 2010.01.22 |
[java] 파일 관련 (0) | 2010.01.07 |
[java] thorws ..... (0) | 2009.12.11 |
[java] 소스 분석 (0) | 2009.09.06 |
variable = setTimeout("function", interval); clearTimeout(variable); |
movement = setTimeout("moveMessage()", 5000); clearTimeout(movement); |
parseInt(string) |
var elem = document.getElementById(elementID); elem.movement = setTimeout(repeat, interval); if(elem.movement) { clearTime(elem.movement); } |
<style type="text/css" media="screen"> @import url("styles/layout.css"); </style> |
* { padding: 0; margin: 0; } |
[html] X-UA-Compatible: IE=EmulateIE7 (0) | 2010.04.09 |
---|---|
[javascript] 전화번호 형식으로 바꾸기 (0) | 2010.03.08 |
[jstl] jstl 사용하기 (0) | 2010.01.08 |
[jsp] jstl 설명 (0) | 2010.01.08 |
[jsp] jstl 설치 (0) | 2010.01.08 |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="java.util.*" %> <%@ page import="test.model.*" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt" %> <% //List<FileBrowsingInfo> fileBrowsingInfoList = (List<FileBrowsingInfo>)request.getAttribute("fileBrowsingInfoList"); %> <c_rt:set var="fileBrowsingInfoList" value='<%=request.getAttribute("fileBrowsingInfoList")%>' /> <!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>파일 목록</title> </head> <body> <c:forEach items="${fileBrowsingInfoList}" var="info"> <c:if test="${info.uploadCompleted}"> </c:if> <c:if test="${!info.uploadCompleted}"> </c:if> <c:out value="${info.name}"></c:out> <br /> <c:set var="childList" value="${info.childList}"></c:set> <c:forEach items="${childList}" var="childInfo"> <c:out value="${childInfo.fileName}"></c:out> <br /> </c:forEach> </c:forEach> </body> </html> |
[javascript] 전화번호 형식으로 바꾸기 (0) | 2010.03.08 |
---|---|
[javascript] DOM 스크립트 (0) | 2010.01.15 |
[jsp] jstl 설명 (0) | 2010.01.08 |
[jsp] jstl 설치 (0) | 2010.01.08 |
[servlet] 서블릿에서 jsp로 포워드하기 (0) | 2010.01.07 |