메뉴 건너뛰기

2016.08.18 11:37

set get 파라미터

조회 수 3658 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

파일 시스템 어플리케이션

j0412_2 Hello3.java
package j0412_2;

public interface Hello3 {
 public String sayHello(String name);
}

 

 

j0412_2 Hello3Imple.java
package j0412_2;

public class Hello3Imple implements Hello3{

 private String name;
 private int age;
 
 
 
 public String getName() {
  return name;
 }

 

 public void setName(String name) {
  this.name = name;
 }

 

 public int getAge() {
  return age;
 }

 

 public void setAge(int age) {
  this.age = age;
 }

 

 @Override
 public String sayHello(String name) {
  // TODO Auto-generated method stub
  return "입력받은 이름은과 나이는 "+name+" : "+age;
 }

}

 

 

j0412_2 Hello3Main3.java
package j0412_2;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class HelloMain3 {

 public static void main(String[] args){
  
  ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:/x0412_2/test3.xml");
  Hello3 h3 =  (Hello3)ctx.getBean("hellgate");
  String a  = h3.sayHello("이현재");
  System.out.println(a);
  System.out.println(h3.sayHello("이현재"));
 }
 
}

 

 

x0412_2패키지 test3.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean id="hellgate" class="j0412_2.Hello3Imple">
 <property name="name"><value>이현재</value></property>
 <property name="age"><value>999</value></property>
</bean>
</beans>


List of Articles
번호 제목 날짜 조회 수
51 JAVA 현재 시간 구하기 file 2018.07.09 1266
50 시간관련 클래스 file 2018.09.21 1186
49 Java : JSOUP 를 이용, html에서 소스, 링크경로 추출후 절대 경로로 바꾸기 2019.01.08 1166
48 JAVA 정규표현식을 이용한 패턴매칭(HTML 제거) 2018.07.09 1164
47 Apache Commons HttpClient 3.x 로 Http 서버에 파일 전송하기 file 2019.01.08 1136
46 JAVA 인코딩을 변경하여 파일 출력하기 (EUC_KR) 2018.07.09 1105
45 JAVA HashMap의 Key값 출력하기 2018.07.09 1079
44 JSON 문자열을 Map 으로 변환하기(Jackson 사용) 2019.01.08 1010
43 JAVA public, private, protected 정리 2018.07.09 1001
42 직렬화 / 역직렬화 file 2018.09.21 951
41 예외처리 / 예외발생 file 2018.09.21 934
40 이클립에서 FTP 접속하면서 Operation failed. File system input or output error 가 날때 file 2019.03.05 878
39 JAVA/JSP SQL Injection 해킹 방지를 위한 코딩 2019.01.10 846
38 A java Runtime Environment(JRE) or Java Development Kit(JDK) must be ~~~~ 하면서 이클립스가 실행안될때. file 2019.03.05 789
37 자바 랜덤 함수(Java random) file 2019.03.05 766
36 이클립에서 Javadoc 생성시 unmappable character for encoding MS949 에러가 발생할때 file 2019.03.05 730
35 java에서 이전 URL 알아내기 2021.03.25 690
34 이클립스에서 같은 파일을 여러 편집창으로 띄우기 file 2019.03.05 677
33 log4j에서 로그가 출력되지 않는 문제 수정 2021.03.25 405
32 XML to JSON , JSON to Map 2020.06.29 262
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved