메뉴 건너뛰기

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
번호 제목 날짜 조회 수
71 로그인 컴포넌트 설치시 뷰 생성 에러 해결방법 (ORA-01031: 권한이 불충분합니다) file 2016.08.29 3874
70 데몬쓰레드 2016.09.13 3099
69 다형성 file 2016.09.13 3260
68 다양한 문자 조합을 이용한 카운팅 구하기 2016.12.09 4941
67 날짜 시간 포맷 제어 자바 클래스 : JAVA DateUtils Date time file 2016.12.09 5233
66 기존 프로젝트, Table, View 모두 다 삭제하기 file 2016.08.29 4608
65 기본적인 스크립트 보안 2019.01.16 6044
64 국제 시간에 따른 날짜 출력 2020.06.29 121
63 공통컴포넌트 생성하기 - 게시판 file 2016.09.19 5754
62 개인정보 마스킹처리 (휴대폰번호, 이메일) 2018.06.26 3941
61 간단한 개인홈페이지 만들어보기 file 2016.08.29 4751
60 [자바(스프링&mybatis&jsp) 프로젝트 & 아파치 &톰켓 연동]3. 이클립스 설치 file 2016.08.18 3756
59 [자바(스프링&mybatis&jsp) 프로젝트 & 아파치 &톰켓 연동 ]9. 이클립스 압타나 플러그인 설치 file 2016.08.18 4012
58 [자바(스프링&mybatis&jsp) 프로젝트 & 아파치 &톰켓 연동 ]11. 이클립스 프로젝트 생성 file 2016.08.18 3972
57 [자바(스프링&mybatis&jsp) 프로젝트 & 아파치 &톰켓 연동 ] 이클립스 프로젝트 생성 순서08.commons-logging 설치 file 2016.08.18 4458
56 [자바(스프링&mybatis&jsp) 프로젝트 & 아파치 &톰켓 연동 ] 이클립스 프로젝트 생성 순서07.commons-collection 설치 file 2016.08.18 3845
55 [자바(스프링&mybatis&jsp) 프로젝트 & 아파치 &톰켓 연동 ] 이클립스 프로젝트 생성 순서04.jdbc 드라이버 설치 file 2016.08.18 4209
54 [객체 지향 언어의 이해] 업캐스팅과 다운캐스팅 file 2021.03.31 157
53 XML to JSON , JSON to Map 2020.06.29 262
52 war로 묶지 않아도 컴파일된 소스 위치 확인하기 file 2016.08.29 4116
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved