-
자바스크립트 참조타입데이터(reference type data)javascript 2020. 11. 6. 08:07
자바스크립트 참조타입데이터(reference type data) premitive type data : string, number, boolean, undefined, null reference type data : array, object, function 원시타입 데이터(Primitive type data)는 변수에 직접 데이터 값을 넣어준다. 각 변수간에 원시타입 데이터를 복사할 경우에 데이터 값이 복사되기 때문에 기존의 데이터에 영향이 가지 않는다. let data1 = 1; //data1 = 1 let data2 = data1; //data2 = 1 //data2라는 변수에 data1의 값을 복사해 넣어주었다. data2 = 2; //data2 = 2 data1 //1 data2 //2 //da..
-
문자열javascript 2020. 10. 28. 21:49
문자열 str[index] var str = 'CodeStates'; console.log(str[0]); //'C' console.log(str[4]); //'S' console.log(str[10]); //'undefined ** Note : index로 접근은 가능하지만 쓸 수는 없음(read-only) ** str[0] = 'G'; console.log(str); //'CodeStates'로 출력됨. 'GodeStates'로 출력되지 않는다. //즉, index로 접근은 가능하지만 쓸 수는 없다.(값을 바꿀 수 없다)(read-only) //하지만 그렇다고해서 에러를 발생시키는 것도 아니니 주의가 필요하다..
-
Function Statements(Declarations) and Expressionsjavascript 2020. 10. 10. 02:14
Function Statements(Declarations) and Expressions Function Declarations function whatDoyouDo(){ } 함수를 이런식으로 선언하는게 Function Statements(Declarations) Function Expressions var whatDoyouDo = function(){ } 이런식으로 선언하는게 Function Expressions이다. 이 둘의 차이는, JavaScript expressions are pieces of code that always produce value, and it doesn't matter how long they are as long as the code results in a singl..
-
스프링mvc 시작시(서버기동시)메소드 실행방법spring 2020. 9. 18. 18:05
스프링에서 서버 기동시 바로 실행되야 하는 메소드가 있을 수 있다. 그럴때 먼저, WebApplicationInitializer 인터페이스를 구현(implements)해서 할 수도 있다. blog.naver.com/PostView.nhn?blogId=mankeys&logNo=220719095906&redirect=Dlog&widgetTypeCall=true web server 시작시 메소드를 실행해 보기 다음과 같이 하면 된다. import javax.servlet.ServletContext;import javax.servlet.ServletException... blog.naver.com 하지만 이경우, 빈들이 다 생성되지 않은 상태에서 실행되서, 데이터베이스에서 데이터를 받아야 하는 메소드를 실행해야..
-
message를 쓸때 주의사항spring 2020. 9. 16. 23:17
스프링에서 message를 쓰기위해서는 자바방식일때 기준으로 ServletAppContext (스프링 빈설정 관리클래스)에 @Bean public ReloadableResourceBundleMessageSource messageSource() { ReloadableResourceBundleMessageSource res = new ReloadableResourceBundleMessageSource(); res.setBasenames("/WEB-INF/properties/error_message"); return res; } 이런식으로 메세지소스를 추가해주고 그안에 프로퍼티 파일의 경로를 설정해주게 된다. 그런데 여기서 메소드의 이름이 messageSource여야만 한다. 메소드의 이름을 abcd등 아무렇..
-
requestScope Bean주입oracle 2020. 9. 15. 17:27
requestScope 방식으로 빈을 주입한다고 해서 HttpServletRequest영역에 담기지는 않는다. 그래서 보통 HttpServletRequest나 Model을 주입받아 Request영역에 담아 JSP로 전달한다. 그런데 자동으로 Request영역에 저장되는 방법이 한가지 있다. xml방식으로 프로젝트 세팅을 하고 이런식으로 빈에 이름을(id) 줘서 빈을 저장한 후, 이름으로 빈을 주입받는다.( @Resource(name="저장된 빈(xml에서 id를 줘서 저장한 빈)"), 그리고 밑의 DataBean2 requestBean2 여기서 requestBean2는 현재 컨트롤러에서 이 변수로 사용하겠다고 지정한 것. 그 후 , bean에 데이터를 넣어준 후 , 모델이나 리퀘스트에 따로 넣어주지 않고..
-
-
Updateoracle 2020. 8. 27. 12:06
●Update : 로우내의 컬럼값을 수정하는 구문이다. update 테이블명 set 컬럼 = 값, 컬럼 = 값... where 조건문 ---------------------------------------------------------- drop table emp01; create table emp01 as select * from emp; select * from emp01; ------------------------------------------------------------- --사원들의 부서 번호를 40번으로 변경한다 update emp01 set deptno = 40; select * from emp01; --사원들의 입사일을 오늘로 변경한다. update emp01 set hiredat..