본문 바로가기
728x90

Programming50

[Trouble shooting] Static classes or parameters is forbidden in thymeleaf 3.0.12 Static classes or parameters is forbidden in thymeleaf 3.0.12 SpringBoot 보안 업데이트로 인해 Thymeleaf 버전 또한 같이 업데이트 하였다. 업데이트 후 다음과 같은 오류를 맞이하였다. Thymeleaf 3.0.12 이후의 버전에서는 아래와 같은 오류가 발생한다. Caused by: org.attoparser.ParseException: Instantiation of new objects and access to static classes or parameters is forbidden in this context (template: "home" - line 9, col 5) at org.attoparser.MarkupParser.parseD.. 2022. 7. 13.
SpringBoot + Thymeleaf Layout 설정 SpringBoot + Thymeleaf Layout 설정 타임리프 Thyemelaf? Thymeleaf는 서버 사이드 템플릿 엔진(Server Side Template Engine)의 한 종류로, 쉽게 컨트롤러가 전달하는 데이터를 이용하여 동적으로 화면을 구성할 수 있게 해주는 역할을 하며, Spring은 공식적으로 Thymeleaf 사용을 권장하고 있습니다. 타임리프 레이아웃 Thymeleaf Layout 일반적으로 웹 사이트는 머리글, 바닥글, 메뉴 등의 공통 페이지 구성 요소를 공유합니다. 이러한 페이지 구성 요소는 동일하거나 다른 레이아웃에서 사용할 수 있습니다. 프로젝트에서 레이아웃을 구성하는 두 가지 주요 스타일은 포함 스타일과 계층 스타일입니다. 두 스타일 모두 Thymeleaf와 함께 가.. 2022. 7. 13.
Spring Boot 웹 프로젝트 생성 Spring Boot 웹 프로젝트 생성 본인의 개발 방식에 맞게 설정한다. 사용할 Dependencies를 추가할 수 있다. 프로젝트 생성 후 나중에 추가가 가능하므로 깊게 고민할 필요는 없다. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.1) 2022-07-08 17:27:47.635 INFO 11604 --- [ main].. 2022. 7. 8.
Spring Boot urlrewritefilter를 이용한 URL 리다이렉션 urlrewritefilter를 이용한 URL 리다이렉션 리다이렉션은 DNS 서버, 웹 서버, 웹 어플리케이션에서 할 수 있다. 이번에는 Spring Boot 내에서 조건이 맞으면 해당 URL로 리다이렉션하는 방법을 알아보자. 우선 spring starter project 를 이용해 urlrewrite 라는 스프링부트 프로젝트를 생성한다. plugins { id 'org.springframework.boot' version '2.7.1' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' id 'war' } group = 'kr.co.urlrewrite' version = '0.0.1-SNAPSHOT' sourceCompatib.. 2022. 7. 5.
파일의 이름과 확장자 분리 / How to get name and extension of a file in java 파일의 이름과 확장자 분리 / How to get name and extension of a file in java package test; public class Test { public static void main(String[] args) { String file = "abcdef.pdf"; int lastIndex = file.lastIndexOf("."); String fileName = file.substring(0, lastIndex); String extension = file.substring(lastIndex + 1); System.out.println("file name : " + fileName); System.out.println("file extension : " + exten.. 2022. 7. 4.
728x90