반응형

기존의 메이븐 프로젝트가 있는 상황에서 테스트 등의 이유로 동일한 환경의 프로젝트를 한 개 더 생성해서 사용할 수 있는 방법


1. 별도의 공간에 신규 이클립스, 신규 메이븐 폴더, 신규 아파치 톰캣, 기존의 Repository 복사

2. 이클립스 실행 후 기존 SVN 연결 후 Check Out 실시

3. 메이븐 폴더(apache-maven-3.2.3) > conf > settings.xml의 </localRepository> --> 주석 하단에 

<localRepository>1번에서 복사한 Repository 절대 경로(예시: D:\test\repository7)</localRepository>

   추가 후 저장

4. 신규 이클립스에서 상단 메뉴 Window - Preferences > Maven > User Settings 이동 후 User Settings

   부분에 메이븐 폴더 > conf > settings.xml을 지정하면 하단 Local Repository 경로가 자동으로

   3번에서 지정한 절대 경로로 변경되는 것을 확인 -> Apply 버튼 -> OK 버튼

※ Repository 폴더를 분리하여 혹시 모를 충돌에 대비


반응형
반응형

스프링 프로젝트를 생성하고 내용을 채우고 테스트로 Debug on Server를 하려고 

하는데 Java Applet, Java Application, JUnit Test만 보이고 

Debug on Server가 보이지 않을 경우 조치 방법



프로젝트 우측 클릭 - Maven - Update Project... 실행 후 다시 메뉴를 띄워보면 Debug on Server가 보일 것이다.


도움을 받은 사이트 : [..ing 블로그] http://iclass.tistory.com/entry/Simple-Spring-Web-Maven-Example

반응형
반응형

Document Object Model (DOM)


What is the Document Object Model?

돔이란 무엇인가?


The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page. This is an overview of DOM-related materials here at W3C and around the web.

돔이란 문서의 내용, 구조와 스타일을 프로그램이나 스크립트를 통해 동적인 접근과 수정이 가능한 플랫폼과 언어 중립적 인터페이스이다. 처리가 완료되어 사용자에게 보여진 문서를 다시 수정해서 그 처리결과를 보여줄 수 있다. 이 페이지에서 W3C 웹에서 돔과 관련된 메뉴얼과 오버뷰를 확인 할 수 있다.


출처 : https://www.w3.org/DOM/

반응형
반응형

웹 문서를 읽을 때, 함수를 실행하는 방법

window.onload = 함수명;


팝업창 띄우는 함수 예시

function popUp(url){

window.open(url, "popup", "width=320, height=480");

}    // 두번째 인자 : 팝업 제어를 위한 이름 설정, 세번째 인자 : 팝업의 기능 설정

반응형
반응형

Fast Reference                                 ▼▼▼


List 입력

List<String> list = new ArrayList<String>();

list.add("QM6");

list.add("SORRENTO");


List 출력(Iterator 사용)

Iterator<String> it = list.iterator();

while(it.hasNext()) {

String str = (String)it.next();

System.out.println(str);

}


List 출력(향상된 for문)

for(Object obj : list) {

String str = (String)obj;

System.out.println(str);

}


Map 입력

Map<Integer, String> map = new HashMap<Integer, String>();

map.put(1, "MALIBU");

map.put(2, "SM6");


Map 출력(Key)

Iterator<Integer> itKey = map.keySet().iterator();

while(itKey.hasNext()) {

System.out.println(itKey.next());

}


Map 출력(Value)

Iterator<String> itValue = map.values().iterator();

while(itValue.hasNext()){

System.out.println(itValue.next());

}


도움받은 사이트 : http://mainia.tistory.com/2323 [녹두장군 블로그]


[추가]

Map<String, Object> 형식 출력

Map<String, Object> paramMap = new HashMap<String, Object>();

for(Map.Entry entry : paramMap.entrySet()){

    System.out.println("key: " + entry.getKey() + " | value: " + entry.getValue());

    }


List<Map<String, Object>> 형식 출력

List<Map<String, Object>> resultMap = new ArrayList<Map<String, Object>>();

for(Map<String, Object> map : resultMap){

for(Map.Entry<String, Object> entry:map.entrySet()){

        String key = entry.getKey();

        Object value = entry.getValue();

    System.out.println("key: " + key + " | value: " + value);

}

}


도움 받은 사이트 : http://stackoverflow.com/questions/36782231/printing-a-java-map-mapstring-object-how

http://stackoverflow.com/questions/5787079/how-to-iterate-a-list-like-listmapstring-object


[Vector 출력]

Iterator it = vector.iterator();

while(it.hasNext()) {

System.out.println(it.next());

}


도움받은 사이트 : https://examples.javacodegeeks.com/core-java/util/vector/vector-iterator-example/


Fast Reference                                 ▲▲▲



반응형
반응형

URL url = new URL("주소");

// URL 클래스 생성


String param = URLEncoder.encode("pdata", "UTF-8") + "=" + URLEncoder.encode(pdata, "UTF-8");

// 파라미터 정의


byte[] postParam = param.getBystges("UTF-8");    

// 파라미터 인코딩


HttpURLConnection con = (HttpURLConnection)url.openConnection();

// 해당 주소의 페이지로 접속을 하고, 단일 HTTP 접속을 하기 위해 캐스트 한다.


con.setRequestMethod("POST");

// POST 방식으로 요청한다.


con.setRequestProperty("Content-Length", String.valueOf(postParam.length));

// 요청 헤더 정의(Content-Length를 매개변수로 전달)


con.setDoOutput(true);

// setDoOutput() 메소드는 URLConnection의 출력 스트림을 사용할지의 여부를 나타낸다. POST방식은 스트림 기반의 데이터 전송 방식이기 때문에 setDoOutput(true)를 실행하여 URLConnection의 출력 스트림을 사용하도록 지정해야 한다.


OutputStream ops = con.getOutputStream();

// 새로운 OutputStream에 요청할 OutputStream을 넣는다.


ops.write(postParam);

// wirte메소드로 파라미터 값들을 바이트단위로 요청


ops.flush();

// 스트림의 버퍼를 비운다.


ops.close();

// 스트림을 닫는다.


jsonObject = (JSONObject)parser.parse(new InputStreamReader(con.getInputStream()));

// 특정 상황에 따라 사용(서버 응답 결과를 보여주기 위해서 필요)


con.disconnect

// 접속 종료


입력할 데이터를 웹서버에 전달하기 위해서 구현된 소스 입니다.

상황에 따라서 참고하여 구현 하세요.


[출처 및 참고] http://ibabo.tistory.com/266

http://javacan.tistory.com/entry/35

반응형
반응형

한국정보통신기술협회 정보통신 용어사전

https://terms.tta.or.kr/main.do

-----------------------------------------------

개인이 운영하는 정보통신기술용어해설 사이트

http://www.ktword.co.kr/

-----------------------------------------------

한국저작권위원회 오픈소스SW 라이선스 종합정보시스템

https://www.olis.or.kr/

 

 

 

반응형
반응형

var toDay = new Date();

toDay.setMonth(toDay.getMonth() - 2);

return $.datepicker.formatDate('yy-mm-dd', toDay);        // datepicker를 사용해서 다음과 같은 return값이 정의 되어 있고 필요한 만큼 입맞에 맞게 수정하여 개발하세요~!

반응형
반응형

→ 오늘 날짜 yyyy/MM/dd 형식으로 나타내기

Date date = new Date();

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

String toDay = sdf.format(date);

toDay.replaceAll("-", "/");


결과 : 2016/09/28


→ 오늘로부터 2달 전 날짜 구하기

Calendar cal = new GregorianCalendar(Locale.KOREA);

cal.setTime(date);

cal.add(Calendar.MONTH, -2);

String twoMonthAgo = sdf.format(cal.getTime());

twoMonthAgo.replaceAll("-", "/");


결과 : 2016/07/28


날짜 관련하여서 필요한데로 커스터마이징이 필요한 경우 하기 사이트 참고하여서 개발하세요~

http://betatester.tistory.com/16

반응형
반응형

JSON 형식의 데이터를 받아서 jqGrid에 뿌려주는 경우 참고하세요~


JSONParser parser = new JSONParser();

JSONObject jsonObject = null;

StringBuilder sbParam = new StringBuilder();


if(config.getProperty("mode").equalsIgnoreCase("local")){  //json 파일을 직접 불러서 jqGrid에 뿌려주는 경우

String jsonPath = '패스는 상황에 맞게 변경 할 것~';

Object obj = parser.parse(new FileReader(jsonPath));

jsonObject = (JSONObject)obj;

}else {    // 서버 URL 호출로 JSON 형식으로 받아서 jqGrid에 JSONObject 형식으로 리턴하는 경우

String url = sbParam.toString();

URL getURL = new URL(url);

HttpURLConnection con = (HttpURLConnection)getURL.openConnection();

jsonObject = (JSONObject)parser.parse(new InputStreamReader(con.getInputStream()));

con.disconnect();

}

return jsonObject.toString();

반응형

+ Recent posts