6월 2023 | ||||||
---|---|---|---|---|---|---|
일 | 월 | 화 | 수 | 목 | 금 | 토 |
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 |
한글 깨짐 처리
application.properties에 설정 추가
# UTF-8 세팅 server.servlet.encoding.charset=UTF-8 server.servlet.encoding.force=true
https://smpark1020.tistory.com/169
2023-05-27 09:03:02
한글 깨짐 처리
http://honeymon.io/tech/2019/10/23/spring-deprecated-media-type.html
2023-05-22 22:47:39
날짜 데이터가 DB 에 문자열로 다음과 같은 한국 표순시 UTC(GMT) 날짜 형식 "2023-03-14T12:00:00+09:00" 저장 처리되는데
다음과 같은 콛로 LocalDateTime 으로 변경 할수 있다.
@Test public void 팝업테스트() { try { PopupVO popupVO=new PopupVO(); PopupVO popup=popupService.findByPopupId(popupVO); System.out.println("팝업테스트() : " +popup.toString()); //T 가있으면 에러 ////2023-03-14T12:00:00+09:00 과 같은 문자열을 LocalDateTime 형으로 변환 결과 : 2023-03-14T12:00 // 포맷터 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss+09:00"); LocalDateTime startDate = LocalDateTime.parse(popup.getStartDate().replaceAll("T", " "), formatter); LocalDateTime endDate = LocalDateTime.parse(popup.getEndDate().replaceAll("T", " "), formatter); System.out.println(startDate + " : " +endDate + " : "+ startDate.isBefore(LocalDateTime.now()) + " : " + endDate.isBefore(LocalDateTime.now())); // 2021-06-19T21:05:07 //시작날짜가 현재날짜보다 작고 true , 종료 날짝 현재시간보다 큰경우 false if(startDate.isBefore(LocalDateTime.now())&& !endDate.isBefore(LocalDateTime.now())) { System.out.println("화면출력 : on"); }else { System.out.println("화면출력 : off"); } }catch(Exception e) { e.printStackTrace(); } }
2023-03-27 14:44:41
★★★ 깃허브 소스 trip.festival 참조 할것
https://github.com/braverokmc79/springboot-green2209S_16
1. net.sf.log4jdbc.DriverSpy 사용하고 있으면 원래 datasource.driverClassName 으로 변경 처리 한다.
2.
package trip.festival; import javax.sql.DataSource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.scheduling.annotation.EnableScheduling; //exclude = { SecurityAutoConfiguration.class } 사용시 시큐리티 자동로그인 설정을 배제한다 @SpringBootApplication() @MapperScan(value = { "trip.festival.model.dao.mapper" }) @EnableScheduling public class Application extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(Application.class); } public static void main(String[] args) { SpringApplication.run(Application.class, args); } @Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource); Resource[] res = new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*Mapper.xml"); sessionFactory.setMapperLocations(res); return sessionFactory.getObject(); } }
3.pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.6</version> <relativePath /> <!-- lookup parent from repository --> </parent> <groupId>trip.festival</groupId> <artifactId>trip-festival</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>system</name> <description>trip.festival</description> <properties> <java.version>11</java.version> </properties> <dependencies>
<build> <finalName>${artifactId}</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <excludes> <exclude> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </exclude> </excludes> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.2</version> <configuration> <skipTests>true</skipTests> </configuration> </plugin> </plugins> <defaultGoal>install</defaultGoal> </build>
4. 빌드
[Spring Boot] Maven 빌드
https://hgko1207.github.io/2021/03/09/springboot-1/
5. Tomcat 서버에 Spring Boot WAR 배포
https://recordsoflife.tistory.com/392
2023-02-27 21:42:14
Window server에 jar 배포하기
Window server에 jar 배포하기
스프링부트로 개발된 프로젝트를 window os 서버에 배포하는 과정을 정리했다.
배포방법에는 foreground와 background배포가 있는데 전자의 방법은 콘솔창을 닫으면 해당 프로세스도 종료되는 방식이다. 서버는 콘솔창이 닫히더라도 진행되어야 하기 때문에 후자의 방법이 권장된다.
[TIP] 콘솔창을 열 때 해당 디렉토리의 주소에 cmd를 입력하면 현재 디렉토리가 터미널에 열리게 된다.
foreground 배포
java -jar JAR-NAME.jar
background 배포
javaw -jar JAR-NAME.jar
프로세스 종료
// javaw 이름으로 실행중인 프로세스를 검색한다 tasklist /svc | findstr javaw // 검색된 프로세스의 id값을 이용해 프로세스를 종료한다 taskkill /pid PID /f taskkill /pid 3778 /f2023-02-27 20:34:21
macaronics.net 는 그어떠한 동영상, 이미지, 파일등을 직접적으로 업로드 제공을 하지 않습니다. 페이스북, 트위터 등 각종 SNS 처럼 macaronics.net 는 웹서핑을 통하여 각종 페이지위치등을 하이퍼링크, 다이렉트링크, 직접링크등으로 링크된 페이지 주소만을 수집 저장하여 제공하고 있습니다. 저장된 각각의 주소에 연결된 페이지등은 그 페이지에서 제공하는 "서버, 사이트" 상황에 따라 페이지와 내용이 삭제 중단 될 수 있으며 macaronics.net 과는 어떠한 연관 관련이 없음을 알려드립니다. 또한, 저작권에 관련된 문제있는 글이나 기타 저작권에 관련된 문제가 있는 것은 연락주시면 바로 삭제해 드리겠습니다.
댓글 ( 0)
댓글 남기기