메모장

  • 홈
  • 태그
  • 방명록

static 2

[Spring] (프로젝트 외부) 정적 리소스 처리

📌0. 서블릿 컨테이너 기본 동작 자원이 프로젝트 내부 /resources 또는 /static 밑에 있을 때✅ 0-1. Spring MVC (레거시 설정, xml 기반)DispatcherServlet을 /에 매핑하면 모든 요청이 DispatcherServlet으로 감.정적 리소스도 DispatcherServlet을 거치게 됨 → 그래서 Spring이 ResourceHttpRequestHandler를 통해 다시 정적 리소스 처리를 해줘야 함.✅ 0-2. Spring Boot 동작 원리스프링부트는 자동으로 ResourceHandlerRegistry를 등록해서, 별도 mvc:resources를 안 써도 정적 리소스 핸들러가 붙음.기본 매핑 경로:classpath:/static/classpath:/public..

Backend/spring (Boot) 2025.07.26

static 키워드

📌 1. static 키워드의 의미static은 "정적인"이라는 의미로, static을 붙이면 객체(instance)와 관계없이 클래스(class) 단위로 관리된다는 뜻이다! 즉, 클래스가 메모리에 로드될 때 한 번만 생성되며, 모든 객체가 공유한다. ✅ 2. static 키워드의 사용✅ 2-1. static 변수 (클래스 변수)모든 객체가 공유하는 변수! (인스턴스와 관계 없음)클래스명.변수명으로 접근 가능객체를 생성하지 않아도 사용 가능📖 예제class Counter { static int count = 0; // 모든 객체가 공유하는 변수 Counter() { count++; // 생성될 때마다 count 증가 }}public class Main { publi..

Backend/JAVA 2025.02.26
이전
1
다음
더보기
프로필사진

  • 분류 전체보기 (303)
    • Frontend (107)
      • javaScript (31)
      • react (30)
      • vue3 (25)
      • angularjs (2)
      • jquery (4)
      • html (4)
      • css (3)
      • HTTP 통신 (8)
    • gridLib (24)
      • auiGrid (2)
      • agGrid (7)
      • jqGrid (15)
    • Backend (69)
      • JAVA (25)
      • spring (Boot) (29)
      • spring cloud (MSA) (10)
      • tomcat (2)
      • API (3)
    • DB (25)
      • 데이터 관리 (5)
      • RDBMS (16)
      • NoSQL (4)
    • python (2)
    • study (43)
      • 클라우드&쿠버네티스 (7)
      • 보안 (6)
      • 알고리즘 문제 풀이 (28)
      • 네트워크 (2)
    • tool (4)
      • git (5)
    • error (13)

Tag

백준, vue emit, JWT, 2024 데브크루, 프로그래머스 dfs bfs, Spring Security, softeer, 프로그래머스 정렬, 프로그래머스, jqgrid, redis, error, mybatis, BFS, MSA, dfs, KINX, JavaScript, dfs bfs, Python,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

Copyright © Kakao Corp. All rights reserved.

티스토리툴바