본문 바로가기

전체 글

(141)
라이브러리 dependency로 추가하고 setting 하기 class는 src/main/java에 컴파일할 파일들 src/main/resources 설정파일들
Maven Project 생성 maven project : 자동빌드툴
web module version web.xml 문서 무조건 안좋은 건 아님 유지보수는 불편하지만 이거 하나만 보고 큰 관점에서 프로젝트 전체를 다 알 수 있음. 서블릿, 필터, 리스너가 어떤 것들이 있는지. 어노테이션은 유지보수는 편하지만 전체구조가 안보임. 소스코드를 다 뜯어봐야함 각각의 장단이 있다. 스프링도 예전엔 xml로 설정하다보니 개발자는 코드랑 xml 둘 다 수정해야함 그래서 스프링에서도 어노테이션화되거나 클래스화 되는 등 점점 바뀜.
Filter @WebFilter("/*") public class MyFilter extends HttpFilter implements Filter { public MyFilter() { super(); // TODO Auto-generated constructor stub } public void destroy() { // TODO Auto-generated method stub } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // TODO Auto-generated method stub // place your code here ..
Listener Listener : 감시자 역할 @WebListener public class MySessionListener implements HttpSessionAttributeListener { private int loginedCnt; public MySessionListener() { // 객체 생성되고 생성자 호출될 때 출력 될 것 System.out.println("MySessionListener객체 생성됨"); } public void attributeAdded(HttpSessionBindingEvent se) { // 객체 생성되고 생성자 호출될 때 출력 될 것 // System.out.println("MySessionListener.attributeAdded()메서드 호출됨"); if(se.getNa..
리플랙션(Reflection) @WebServlet("/") public class DispatcherServlet extends HttpServlet { private static final long serialVersionUID = 1L; private String envFileName = "control.properties"; private Properties env; public DispatcherServlet() { super(); } @Override public void init() throws ServletException { super.init(); env = new Properties(); ServletContext sc = this.getServletContext(); // 여기까지 서블릿 context 찾는 객체..
Git Bash로 프로젝트 repository commit log 포함해서 개인 repository로 옮기기 * 내 github 계정에 read me없이 repository 생성하기 * 컴퓨터에 빈 폴더 생성 우클릭해서 Open Git Bash here git clone --mirror https://github.com/아이디/가져올repository이름.git 완료되면 cd 가져올repository이름.git git push --mirror https://github.com/아이디/생성한repository이름.git 만약에 아래와 같은 에러 뜨면 ! [remote rejected] refs/pull/1/head -> refs/pull/1/head (deny updating a hidden ref) * 컴퓨터에 빈 폴더 생성 우클릭해서 Open Git Bash here git clone --bare https:..
Git push 하기 결과 커밋 뒤에 코멘트 있는데 명령어가 별도로 있음 fix같은, 커밋한거 취소할 수 있는 명령어도 있음