8월, 2010의 게시물 표시

Struts 사용시 경고 메시지 Server/Service/Engine/Host/Context 처리

-Tomcat6.0버전을 처음 사용해 보면서, 문제가 발생했다. 출처의 아티클을 보면 알겠지만, Tomcat 6.0부터 지원하는 source라는 Attribute 때문에 일어나는 문제라고 한다.   Warning :  [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source'     to  'org.eclipse.jst.j2ee.server:demo' did not find a matching property   Solution : Server's Properties -> General -> Location = /Servers/Tomcat v6.0 Server at localhost.server; Project Explorer -> Servers -> Tomcat v6.0 Server at localhost.server, double click to open it. Server Options -> Check " Publish module contexts to separate XML files ". Explaination : Tomcat of previous version doesn't support the "source" attribute in the "Context" node of "server.xml" file. Result : A separate XML file named "demo.xml" was created in the "$server path$\conf\Catalina\localhost\". Reference : http://www.ibm.com/developerworks/opensource/library/os-eclipse-...

Spring

Spring IoC (Inversion of Control)  콘트롤 전도(반전)  역전 EJB  (Enterprise javaBean)  Container 에 의존하는 객체 (복잡하고 개발자가 쓰기 어렵다는것?) POJO ( Plain Old java Object) 자바개발자가 마음대로 정의 할수 있는 객체,  Object 를 간단히 수퍼클래스로 둔 보통의         평법의 순수 자바 클래스라고 볼수 있다고 한다. POJO 의 필수 요소 - Light-weight (possibly) : 가볍게 - Flexible : 유연성 - Simple : 간단 명료 - Supported by Separate optional compnents such as hibernate or Spring - 즉 , Spring , Hibernate, Ibatis 등에서 객체를 가볍게, 간단히 유연하게 어떤 Object 에 대해 추상화 할수 있는 객체를 만들어야 한다. AOP (Aspect Oriented Programming  ) 관점지향 프로그래밍 Aspect : 양상,관점,모습,면,방향,방면,용모,외양,방위,상,별의 상             ex) a mountain with a beatiful aspect : 모습이 아름다운 산                  consider a question in all its aspects (from every aspedt)  문제를 모든 각도에서 고찰하다. Avalon : 은 영국(United Kingdom Of Great britain and Northern Ireland)의 어디엔가에 있었다고 여겨지는 전설상의 섬이다.         ...

Spring Dynamic Modules for OSGi(tm) Runtimes 배우기

OSGi =  Open Service Gateway initiative Alliance 는 1999년에 Sun Microsystems ,IBM, Ericsson 등이 구성한             개방형 표준 단체이다. 자세한것은 위키 백과 http://ko.wikipedia.org/wiki/OSGi  참고바람. 처음에는 Connected Alliance 라고 불렸다고 한다. 이 표준 사양의 핵심은 Application Program 의 Life cycle 은 Model and Service Registry 를 정의 하는 Framework 이다. OSGi Framework 은 독립적인 Jave / Virtual Machine 환경에서 제공하고 있지 못한 세련되고, 완전하며 동적인 Component Model 을 구현한다. 응용프로그램 또는 구성요소(번들,Bundle) 는 다시 시동과정 없이 원격지를 통해 Installed,Stated ,Stoped,Updated and Uninstalled 할수있다. OSGi 는 Embeddable( Appplication 내보로 포함될수있는) SOA 를 구현하고 있다. SOA = Service Oriented Architecture (서비스 지향 아키텍처) , Service , Message 로 구성. Web service based SOA 가 네트워크를 중심으로 하는 SOA 라면 OSGi 는 Java Object based SOA 이다.                     Initiative : (명) 발의,초보,의안제출권,기업심,선제,선창,주도(권) ,독창력,창업의 재간, 국민발안,의안 제출권 Component : (명) 구성요소 (형) 구성하고 있는

유투브 동영상 섬네일 가져오기

유투브( youtube )의 동영상 썸네일이 필요할 때가 있습니다. 물론 유투브 개발자센터 에 유투브 API활용에 대한 친절하고도 자세한 설명이 나와있지만, 죄다 영문에 상당히 읽기 빡빡한 문서입니다. 혹시 다른건 다 필요없고 유투브에서 동영상 썸네일만 필요하신 분들을 위한 팁. 유투브의 동영상은 해당 페이지의 고유한 주소가 있습니다. http://www.youtube.com/watch?v=2hTRAVIXjX8 http://www.youtube.com/watch?v=OgyVGamz_Kk http://www.youtube.com/watch?v=qj4grv8qFoQ v= 다음에 나오는 영문과 숫자의 조합이 바로 동영상에 대한 id값입니다. 바로 이 id값만 알면 해당 동영상의 썸네일 이미지를 가져올수 있습니다. http://img.youtube.com/vi/2hTRAVIXjX8/2.jpg http://img.youtube.com/vi/OgyVGamz_Kk/2.jpg http://img.youtube.com/vi/qj4grv8qFoQ/2.jpg http://img.youtube.com/vi/동영상id/2.jpg 바로 이러한 형식으로 url을 요청하면 해당 동영상의 120*90의 썸네일 이미지를 가져올 수 있습니다. 한개의 동영상에는 3개의 썸네일 이미지가 등록되어있고 파일이름은 각각 1.jpg, 2.jpg, 3.jpg 입니다. 동영상주소 : http://www.youtube.com/watch?v=2hTRAVIXjX8 썸네일주소 : http://img.youtube.com/vi/2hTRAVIXjX8/2.jpg 썸네일이미지

Thumbnail Generator

    /*   *   * Part of the InfoGlue Content Management Platform (www.infoglue.org)   *   *   *   *  Copyright (C)   *   * This program is free software; you can redistribute it and/or modify it under   * the terms of the GNU General Public License version 2, as published by the   * Free Software Foundation. See the file LICENSE.html for more information.   *   * This program is distributed in the hope that it will be useful, but WITHOUT   * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS   * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.   *   * You should have received a copy of the GNU General Public License along with   * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple   * Place, Suite 330 / Boston, MA 02111-1307 / USA.   *   *   */ import java.awt.*; im...

iframe content remove

document.testIframe.document.body.innerHTML=""

Java Enumeration is a raw type. References to generic type Enumeration<E> should be parameterized

Enumeration is a raw type. References to generic type Enumeration<E> should be   parameterized forum.sun.com -------------------------------------------------------------------------------------------- Hi, I am getting a compilation warning at the statement Enumeration<String> params = (Enumeration<String>)request.getParameterNames(); I am facing problem in removing this warning. I don't want to use @SuppressWarnings("unchecked") Can anyone please help in removing this warning? --------------------------------------------------------------------------------------------- I see two options. The first is to change request.getParameterNames() to return Enumeration<String> instead of Enumberation assuming that getParameterNames always returns Strings. The other is to use a wild card enumeration instead of a Enumeration<String>. Since all objects can be converted to Strings it will allow you to use the Enumeration without getting any class ...

frame 이동

1. 자식창에서 부모창의 특정 Form 에 데이터를 집어넣고 싶을 때   자식창에서 부모창을 가리킬 때 opener 객체를 사용한다 . document.Form.input 은 부모창에   속해있는 요소이다 . ( 자바스크립트 함수 호출 도 opener를 사용하면 된다 !)   opener .document.Form.input.value = “ 값 ”;       2. 자식창에서 부모창의 페이지를 이동시키고 싶을 때   부모창을 원하는 페이지로 이동시킨후 자식창 ( 자기자신 ) 은 닫는다 .   window.opener.location.href = “/admin/login.jsp” ;   window.close();     3. 자식창에서 부모창을 새로고침하고 싶을 때   if (!opener.closed){   opener.document.location.reload();   window.close();   }     4. iframe 내부에서 외부에 있는 메인페이지의 특정 Form 에 값을 집어넣고 싶을 때   iframe 에서 메인을 가리킬때는 parent 객체로 접근한다 . ( 자바스크립트 함수 호출 도 parent를 사용하면 된다 !)   parent.Form.input.value = “ 값 ”;     5. iframe 내부에서 외부에 있는 메인페이지의 스크립트 함수를 실행하고자 할 때   parent.[ 메인함수명 ]   parent.DoSend();       6. 메인에서 iframe 의 페이지를 이동시키고 싶을 때 ...

Image Thumbnail

<%@ page language="java" contentType="text/html; charset=EUC-KR"     pageEncoding="EUC-KR"%>     <%@ page import="java.io.* "%> <%@ page import="java.io.File" %> <%@ page import="java.awt.Image , java.awt.image.BufferedImage" %>    <%@ page import="java.util.*"%> <%@ page import="javax.imageio.ImageIO" %> <%@ page import="java.awt.Graphics2D" %> <%@ page import="java.awt.Graphics2D" %> <!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> </head> <body> <%             //String files = application.                     String file = application.getRealPath("./");           ...

image Thumbnal Make

이 요약은 사용할 수 없습니다. 이 글을 보려면 여기를 클릭하세요.

jsp cos.jar multipart file Upload

cos.jar => 파일 업로드와 enctype="multipart/form-data"로 넘겨져 오는 파라미터에 대한 이름과 값을 얻어낼 수 있다.   2. 1) testController에서 MultipartRequest를 사용하기 위해서 com.oreilly.servlet 패키지를 import 해야한다. ex.import com.oreilly.servlet.*;   2) MultipartRequest는 객체를 생성하자마자 파일을 업로드시킨다. ex. MultipartRequest multi = new MultipartRequest(request, "파일저장경로(String)", 파일크기(int), "인코딩"); 3) MultipartRequest를 사용하게되면 톰캣의 request 객체의 getParameter 메소드를 이용하여 값을 전달받지 못한다. 따라서 MultipartRequest를 사용하게 되면 값을 전달받기 위해서는 MultipartRequest 객체의 getParameter 메소드를 이용하여 값을 전달받아야 한다. ex. String user = multi.getParameter("user"); 4) 파일을 저장할 경로는 톰캣의 내장객체인 application.getRealPath() 메소드를 사용한다. ex. String fileSave = application.getRealPath("fileSave"); MultipartRequest multi = new MultipartRequest(request, fileSave); 5) 전송한 파일 정보를 가져온다. ex. Enumeration file = multi.getFileNames(); while(files.hasMoreElements()){ // 파일 정보가 있다면     String name = (String)files.nextElement(); //...