반응형

currval(현재 번호)을 쓰면된다. 개꿀 

한 테이블엔 nextval로 새 값을 주고, 다른 테이블엔 그 번호를 currval로 쓰면 됨.

sequence이름.currval

반응형
반응형

jsp form에서 항상 VO타입 지정하고 보냈는데 지정하지 않아도 controller에서 알아서 VO에 담김 

 

받을 때 여러개로 받으면 된다 . 개꿀~^0^

반응형
반응형

1. 다운로드

logging.apache.org/log4j/1.2/download.html

 

Apache log4j 1.2 - Download Apache log4j 1.2

Log4j 2 is nominated for the JAX Innovation Awards! Do you like its performance, garbage-free logging, and easy and flexible configuration? Log4j 2 needs your love. Vote for Log4j 2! End of Life On August 5, 2015 the Logging Services Project Management Com

logging.apache.org

log4j-1.2.17.zip파일 다운로드 > 압축 해제

 

2. jar 파일을 라이브러리에 추가 spring의 경우 pom.xml에 dependency 있는지 확인

 

 

3. /src/main/resources 밑에 log4j.xml

open with xml editor

appender : 로그를 출력하는 위치
logger : 로그 파일을 작성하는 클래스 

 

사용

import org.apache.log4j.Logger

임포트

Logger log = Logger.getLogger(This.getClass));

로거 생성

 

if(log.isDebugEnabled()) {

      log.debug("로그 내용")

}  로그 찍기

반응형
반응형

JSP view에서 input으로 받은 데이터가 Controller로 전달이 안 되고 계속 null값만 보여짐

<form:form action="save.do" type="post"commandName="CardVO" encType="multipart/form-data">

<input type="text" name="user_name">

 

이런 코드인데 VO를 보내면 Controller에서 자꾸 null이 찍힘

encType="multipart/form-data" 때문이었음

지우니까 잘됨

 

1. form:form 기본 method는 post로, post를 명시할 필요 X 

2. encType="multipart/form-data" 는 input type file 이 있는 경우에만 써야함(file upload 시)

반응형
반응형

Could not publish to the server. java.lang.IndexOutOfBoundsException 에러

C:\Users\사용자명\.m2

repository 삭제 -> eclipse 다시 시작 -> 프로젝트 우클릭 -> Maven -> update project 

하게 되면 각종 라이브러리를 다시 받으면서 메이븐 업데이트가 됨. 완료 되고 실행해보면 이제 된다. ^.ㅠ 시바 

반응형
반응형

<eclipse>

Port 8080 required by Tomcat v9.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

<vscode>

The Tomcat connector configured to listen on port 8443 failed to start.

ERROR o.apache.catalina.util.LifecycleBase - Failed to initialize component [Connector[HTTP/1.1-8080]]

톰캣 서버 포트가 이미 사용중일 때 생기는 에러.

cmd > netstat -p tcp -ano | grep 포트번호

하여 pid 확인 후 

taskkill /f /pid [pid] 로 종료 후 tomcat 재시작해주면 됨 

반응형

+ Recent posts