스프링(9)
-
props, autowired
map props bean 010 011 018 main GenericXmlApplicationContext ctx= new GenericXmlApplicationContext("classpath:com/spring/stu.xml"); Student stu= ctx.getBean("student", Student.class); Map map= stu.getMapCat(); Set keys= map.keySet(); for (String key : keys) { System.out.println(map.get(key)); } System.out.println("============="); Properties props= stu.getPhones(); Set xxx= props.stringPropertyN..
2024.02.07 -
spring - property
property 이순신 echoBean public class EchoBean { String aaa; public String sayEcho() { return "hello"; } public EchoBean() { System.out.println("반드시 필요ㅘㄴ !!! 기본생ㅇ성자 호출"); } public String getAaa() { return aaa; } public void setMesg(String mesg) { System.out.println("setMesg(String mesg)호출"); this.aaa = mesg; } } main GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("classpath:com..
2024.02.06 -
스프링 준비
sts 기본 설정 general - workspace - 한글설정 css/jsp/html 한글설정 jre jdk11 기본 브라우저 chrome 스프링 import 후 ⇒ pom파일을 읽고 다운로드 pom파일 maven update : alt+ f5 build path 확인 classpath 확인 하기!!!!!!!!!!!!!! xml bean 에 id 찾기 ❗❗ no search bean 이면 id 가 틀린 것❗❗ 똑같은 아이디 두 개 를 bean 에 넣지 말 것 ❗❗ xml에 id 부여하기 Person.java package com.spring; public class Person { String name ="홍길동"; public Person() { super(); System.out.println("..
2024.02.05