반응형
const cbxShipDayRef = useRef(new Array(7));
<td>{['월', '화', '수', '목', '금', '토', '일'].map((n, i) =>
 <div key={n}>
  <CheckBoxComponent label={n}
   ref={(el) => { if (el !== null) {
    cbxShipDayRef.current[i] = el;
    cbxShipDayRef.current[i].value = n;
    cbxShipDayRef.current[i].checked = el.checked;
   } }}
   />&nbsp;&nbsp;&nbsp;
  </div>)}
</td>
 

https://velog.io/@rkio/Typescript-React%EC%97%90%EC%84%9C-useRef-%EC%97%AC%EB%9F%AC-%EA%B0%9C-%ED%95%9C%EB%B2%88%EC%97%90-%EC%84%A0%EC%96%B8%ED%95%98%EA%B8%B0useRef-%EB%B0%B0%EC%97%B4-%EB%A7%8C%EB%93%A4%EA%B8%B0

 

[Typescript] React에서 useRef 여러 개 한번에 선언하기(useRef 배열 만들기)

문제 상황 > 필자가 토이 프로젝트를 진행 중에 마주한 고민이다. useRef를 통해서 특정 요소 클릭 시 특정 이미지로 스크롤이 이동하도록 구현하고자 했다. 이 때, 이미지가 5개 사용되었고, 따라

velog.io

 

반응형
반응형

 

export const getTimeString = (time) => {
  const milliSeconds = new Date() - time;
  const seconds = milliSeconds / 1000;
  if (seconds < 60) return `방금 전`;
  const minutes = seconds / 60;
  if (minutes < 60) return `${Math.floor(minutes)}분 전`;
  const hours = minutes / 60;
  if (hours < 24) return `${Math.floor(hours)}시간 전`;
  return time?.toLocaleString();
  const days = hours / 24;
  if (days < 7) return `${Math.floor(days)}일 전`;
  const weeks = days / 7;
  if (weeks < 5) return `${Math.floor(weeks)}주 전`;
  const months = days / 30;
  if (months < 12) return `${Math.floor(months)}개월 전`;
  const years = days / 365;
  return `${Math.floor(years)}년 전`;
}

 

 

반응형
반응형

2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] kr.co.cjons.frame.dao.AbstractDao -   QueryId   :  common.updateSql
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] org.mybatis.spring.SqlSessionUtils - Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e3594ef] from current transaction
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] common.updateSql - ==>  Preparing: UPDATE mdm_alarm SET alarm_type_cd = 'ALARM_ENV' ,alarm_content = '[Farm N] 본인확인 인증번호는 ? 입니다' ,alarm_template_cd = '' ,use_yn = 'Y' ,alarm_id = 'ALARM_009' ,alarm_template_content = '' ,alarm_nm = '9' ,action_yn = 'N' ,tx_type_cd = 'U' , evt_nm = '/AlarmRule/saveAlarms' ,evt_user_id = 'poorhearte' ,evt_dt = to_timestamp('20240208152714', 'YYYYMMDDHH24MISS') ,tx_id = '884d0213-d06c-4fe0-9aab-b5b7937c070a' ,hist_key = '4efdaf7e-ad17-4ebb-9b18-fa43b8fbd8a3' WHERE alarm_id = 'ALARM_009'
2024-02-08 15:27:14 [http-nio-8007-exec-9] [ERROR] jdbc.sqltiming - 51. PreparedStatement.setNull(1, 1111)
org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.postgresql.jdbc.PgPreparedStatement.setNull(PgPreparedStatement.java:192)
at net.sf.log4jdbc.sql.jdbcapi.PreparedStatementSpy.setNull(PreparedStatementSpy.java:266)
at cohttp://m.zaxxer.hikari.pool.HikariProxyPreparedStatement.setNull(HikariProxyPreparedStatement.java)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:67)
at cohttp://m.sun.proxy.$Proxy117.setNull(Unknown Source)
at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:65)
at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:87)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:94)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:64)
at org.apache.ibatis.executor.BatchExecutor.doUpdate(BatchExecutor.java:71)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
at cohttp://m.sun.proxy.$Proxy113.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:287)
at kr.co.cjons.frame.dao.AbstractDao.update(AbstractDao.java:45)
at kr.co.cjons.frame.dao.CommonDao.update(CommonDao.java:119)
at kr.co.cjons.frame.dao.CommonDao$$FastClassBySpringCGLIB$$47233cce.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at kr.co.cjons.frame.dao.CommonDao$$EnhancerBySpringCGLIB$$8c6a35a7.update(<generated>)
at kr.co.cjons.frame.dao.CrudUtils.update(CrudUtils.java:346)
at kr.co.cjons.frame.dao.CrudUtils.execGridBatch(CrudUtils.java:1142)
at kr.co.cjons.ruleService.mdm.AlarmRule.saveAlarms(AlarmRule.java:35)
at kr.co.cjons.ruleService.mdm.AlarmRule$$FastClassBySpringCGLIB$$8c31b3e4.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at kr.co.cjons.ruleService.mdm.AlarmRule$$EnhancerBySpringCGLIB$$b2c78ea8.saveAlarms(<generated>)
at jdk.internal.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at kr.co.cjons.controller.RestApiController.callRule(RestApiController.java:170)
at jdk.internal.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e3594ef]
2024-02-08 15:27:14 [http-nio-8007-exec-9] [ERROR] kr.co.cjons.frame.dao.CrudUtils - nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='인증번호', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='인증번호', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
at cohttp://m.sun.proxy.$Proxy113.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:287)
at kr.co.cjons.frame.dao.AbstractDao.update(AbstractDao.java:45)
at kr.co.cjons.frame.dao.CommonDao.update(CommonDao.java:119)
at kr.co.cjons.frame.dao.CommonDao$$FastClassBySpringCGLIB$$47233cce.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at kr.co.cjons.frame.dao.CommonDao$$EnhancerBySpringCGLIB$$8c6a35a7.update(<generated>)
at kr.co.cjons.frame.dao.CrudUtils.update(CrudUtils.java:346)
at kr.co.cjons.frame.dao.CrudUtils.execGridBatch(CrudUtils.java:1142)
at kr.co.cjons.ruleService.mdm.AlarmRule.saveAlarms(AlarmRule.java:35)
at kr.co.cjons.ruleService.mdm.AlarmRule$$FastClassBySpringCGLIB$$8c31b3e4.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at kr.co.cjons.ruleService.mdm.AlarmRule$$EnhancerBySpringCGLIB$$b2c78ea8.saveAlarms(<generated>)
at jdk.internal.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at kr.co.cjons.controller.RestApiController.callRule(RestApiController.java:170)
at jdk.internal.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='인증번호', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:89)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:94)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:64)
at org.apache.ibatis.executor.BatchExecutor.doUpdate(BatchExecutor.java:71)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
... 124 more
Caused by: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:67)
at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:87)
... 134 more
Caused by: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.postgresql.jdbc.PgPreparedStatement.setNull(PgPreparedStatement.java:192)
at net.sf.log4jdbc.sql.jdbcapi.PreparedStatementSpy.setNull(PreparedStatementSpy.java:266)
at cohttp://m.zaxxer.hikari.pool.HikariProxyPreparedStatement.setNull(HikariProxyPreparedStatement.java)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:67)
at cohttp://m.sun.proxy.$Proxy117.setNull(Unknown Source)
at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:65)
... 135 more
2024-02-08 15:27:14 [http-nio-8007-exec-9] [ERROR] k.co.cjons.ruleService.mdm.AlarmRule - nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='인증번호', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] org.mybatis.spring.SqlSessionUtils - Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e3594ef]
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] org.mybatis.spring.SqlSessionUtils - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e3594ef]
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] o.s.j.d.DataSourceTransactionManager - Initiating transaction rollback
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] o.s.j.d.DataSourceTransactionManager - Rolling back JDBC transaction on Connection [HikariProxyConnection@1944485347 wrapping net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy@6f83c55b]
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] o.s.j.d.DataSourceTransactionManager - Releasing JDBC Connection [HikariProxyConnection@1944485347 wrapping net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy@6f83c55b] after transaction
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='인증번호', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
at cohttp://m.sun.proxy.$Proxy113.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:287)
at kr.co.cjons.frame.dao.AbstractDao.update(AbstractDao.java:45)
at kr.co.cjons.frame.dao.CommonDao.update(CommonDao.java:119)
at kr.co.cjons.frame.dao.CommonDao$$FastClassBySpringCGLIB$$47233cce.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at kr.co.cjons.frame.dao.CommonDao$$EnhancerBySpringCGLIB$$8c6a35a7.update(<generated>)
at kr.co.cjons.frame.dao.CrudUtils.update(CrudUtils.java:346)
at kr.co.cjons.frame.dao.CrudUtils.execGridBatch(CrudUtils.java:1142)
at kr.co.cjons.ruleService.mdm.AlarmRule.saveAlarms(AlarmRule.java:35)
at kr.co.cjons.ruleService.mdm.AlarmRule$$FastClassBySpringCGLIB$$8c31b3e4.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at kr.co.cjons.ruleService.mdm.AlarmRule$$EnhancerBySpringCGLIB$$b2c78ea8.saveAlarms(<generated>)
at jdk.internal.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at kr.co.cjons.controller.RestApiController.callRule(RestApiController.java:170)
at jdk.internal.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='인증번호', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:89)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:94)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:64)
at org.apache.ibatis.executor.BatchExecutor.doUpdate(BatchExecutor.java:71)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
... 124 more
Caused by: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:67)
at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:87)
... 134 more
Caused by: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.postgresql.jdbc.PgPreparedStatement.setNull(PgPreparedStatement.java:192)
at net.sf.log4jdbc.sql.jdbcapi.PreparedStatementSpy.setNull(PreparedStatementSpy.java:266)
at cohttp://m.zaxxer.hikari.pool.HikariProxyPreparedStatement.setNull(HikariProxyPreparedStatement.java)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:67)
at cohttp://m.sun.proxy.$Proxy117.setNull(Unknown Source)
at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:65)
... 135 more
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] k.c.c.f.e.RuleExceptionHandler - Runtime Exception
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] k.c.c.frame.message.MessageHandler - ########### language ========================== KO
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.PooledConnectionProvider - [6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Channel acquired, now: 1 active connections, 0 inactive connections and 0 pending acquire requests.
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.http.client.HttpClientConnect - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Handler is being applied: {uri=http://127.0.0.1:8000/api/platform/inquiry/multiLanguage/getLanguageData, method=POST}
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] onStateChange(POST{uri=/api/platform/inquiry/multiLanguage/getLanguageData, connection=PooledConnection{channel=[id: 0x6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000]}}, [request_prepared])
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] o.s.h.codec.json.Jackson2JsonEncoder - [32b38773] Encoding [{"params":{"lang_type_cd":"KO","msg_type_cd":"MESSAGE","lang_cd":"SYS_0001"}}]
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] onStateChange(POST{uri=/api/platform/inquiry/multiLanguage/getLanguageData, connection=PooledConnection{channel=[id: 0x6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000]}}, [request_sent])
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.http.client.HttpClientOperations - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Received response (auto-read:false) : [Vary=Origin, Vary=Access-Control-Request-Method, Vary=Access-Control-Request-Headers, Date=Thu, 08 Feb 2024 06:27:14 GMT, Keep-Alive=timeout=60, X-Content-Type-Options=nosniff, X-XSS-Protection=1; mode=block, Cache-Control=no-cache, no-store, max-age=0, must-revalidate, Pragma=no-cache, Expires=0, X-Frame-Options=DENY, Content-Type=application/json, Transfer-Encoding=chunked]
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] onStateChange(POST{uri=/api/platform/inquiry/multiLanguage/getLanguageData, connection=PooledConnection{channel=[id: 0x6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000]}}, [response_received])
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] reactor.netty.channel.FluxReceive - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] FluxReceive{pending=0, cancelled=false, inboundDone=false, inboundError=null}: subscribing inbound receiver
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.http.client.HttpClientOperations - [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Received last HTTP packet
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] o.s.h.codec.json.Jackson2JsonDecoder - [32b38773] [6161ce24-2, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Decoded [{"result":[{"LANG_CD":"SYS_0001","ENT_CD":"B10","EVT_USER_ID":"admin","TX_TYPE_CD":"","HIST_KEY":"", (truncated)...]
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] onStateChange(POST{uri=/api/platform/inquiry/multiLanguage/getLanguageData, connection=PooledConnection{channel=[id: 0x6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000]}}, [response_completed])
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] onStateChange(POST{uri=/api/platform/inquiry/multiLanguage/getLanguageData, connection=PooledConnection{channel=[id: 0x6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000]}}, [disconnecting])
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Releasing channel
2024-02-08 15:27:14 [http-nio-8007-exec-9] [ERROR] k.c.c.controller.RestApiController - [SYSTEM_ERROR] ::: java.lang.reflect.InvocationTargetException
2024-02-08 15:27:14 [reactor-http-nio-5] [DEBUG] r.n.r.PooledConnectionProvider - [6161ce24, L:/127.0.0.1:51477 - R:/127.0.0.1:8000] Channel cleaned, now: 0 active connections, 1 inactive connections and 0 pending acquire requests.
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] k.c.c.controller.RestApiController - Return Data  :::::  {"status":"FAIL","ruleReturnData":{},"messageInfo":{"messageCode":"SYS_0001","message":"","messageType":"ERROR"}}



2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] o.s.s.w.c.HttpSessionSecurityContextRepository - Did not store anonymous SecurityContext
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] o.s.s.w.c.HttpSessionSecurityContextRepository - Did not store anonymous SecurityContext
2024-02-08 15:27:14 [http-nio-8007-exec-9] [DEBUG] o.s.s.w.c.SecurityContextPersistenceFilter - Cleared SecurityContextHolder to complete request
2024-02-08 15:27:26 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2024-02-08 15:27:53 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2024-02-08 15:28:09 [pool-1-thread-1] [DEBUG] o.a.h.i.c.PoolingHttpClientConnectionManager - Closing expired connections
2024-02-08 15:28:09 [pool-1-thread-1] [DEBUG] o.a.h.i.c.PoolingHttpClientConnectionManager - Closing connections idle longer than 30 SECONDS
2024-02-08 15:28:14 [reactor-http-nio-5] [DEBUG] r.n.r.DefaultPooledConnectionProvider - [6161ce24, L:/127.0.0.1:51477 ! R:/127.0.0.1:8000] onStateChange(PooledConnection{channel=[id: 0x6161ce24, L:/127.0.0.1:51477 ! R:/127.0.0.1:8000]}, [disconnecting])
2024-02-08 15:28:21 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2024-02-08 15:28:48 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2024-02-08 15:29:09 [pool-1-thread-1] [DEBUG] o.a.h.i.c.PoolingHttpClientConnectionManager - Closing expired connections
2024-02-08 15:29:09 [pool-1-thread-1] [DEBUG] o.a.h.i.c.PoolingHttpClientConnectionManager - Closing connections idle longer than 30 SECONDS
2024-02-08 15:29:14 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2024-02-08 15:29:42 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 1 triggers
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] org.quartz.core.JobRunShell - Calling execute on job MES-JOB.WeatherForecastBatch_job
2024-02-08 15:30:00 [quartzScheduler_QuartzSchedulerThread] [DEBUG] o.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] o.s.j.d.DataSourceTransactionManager - Creating new transaction with name [kr.co.cjons.ruleService.batch.BatchRule.updateBatch]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,timeout_100000,-java.lang.Exception
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] o.s.j.d.DataSourceTransactionManager - Acquired Connection [HikariProxyConnection@1707777815 wrapping net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy@6f83c55b] for JDBC transaction
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] o.s.j.d.DataSourceTransactionManager - Switching JDBC Connection [HikariProxyConnection@1707777815 wrapping net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy@6f83c55b] to manual commit
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] kr.co.cjons.frame.dao.CommonDao - ########################## queryId : cache.selectTableColumnInfos ##########################
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] kr.co.cjons.frame.dao.AbstractDao -   QueryId   :  cache.selectTableColumnInfos
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] org.mybatis.spring.SqlSessionUtils - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@793e5f71]
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] cache - Cache Hit Ratio [cache]: 0.24623115577889448
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] o.m.s.t.SpringManagedTransaction - JDBC Connection [HikariProxyConnection@1707777815 wrapping net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy@6f83c55b] will be managed by Spring
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] cache.selectTableColumnInfos - ==>  Preparing: SELECT A.table_name as "TABLE_NAME" ,A.column_name as "COLUMN_NAME" ,A.udt_name as "DATA_TYPE" FROM INFORMATION_SCHEMA.columns A WHERE 1=1 AND A.table_name = ? ORDER BY A.ordinal_position
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] cache.selectTableColumnInfos - ==> Parameters: sys_batch(String)
2024-02-08 15:30:00 [quartzScheduler_Worker-5] [DEBUG] jdbc.sqltiming -  cohttp://m.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPr

반응형
반응형

https://codepen.io/vitaly-zdanevich/pen/MaEJga

<form>
  <input id="phone" 
         type="tel" 
         name="phone" 
         value="+375 (__) ___-__-__" 
         pattern="^\+375 \((17|29|33|44)\) [0-9]{3}-[0-9]{2}-[0-9]{2}$" 
         required>

    <button>Push</button>
</form>
// angelwatt.com/coding/masked_input.php

window.onload = function() {
   MaskedInput({
      elm: document.getElementById('phone'),
      format: '+375 (__) ___-__-__',
      separator: '+375 ()-'
   });
};

// masked_input_1.4-min.js
(function(a){a.MaskedInput=function(f){if(!f||!f.elm||!f.format){return null}if(!(this instanceof a.MaskedInput)){return new a.MaskedInput(f)}var o=this,d=f.elm,s=f.format,i=f.allowed||"0123456789",h=f.allowedfx||function(){return true},p=f.separator||"/:-",n=f.typeon||"_YMDhms",c=f.onbadkey||function(){},q=f.onfilled||function(){},w=f.badkeywait||0,A=f.hasOwnProperty("preserve")?!!f.preserve:true,l=true,y=false,t=s,j=(function(){if(window.addEventListener){return function(E,C,D,B){E.addEventListener(C,D,(B===undefined)?false:B)}}if(window.attachEvent){return function(D,B,C){D.attachEvent("on"+B,C)}}return function(D,B,C){D["on"+B]=C}}()),u=function(){for(var B=d.value.length-1;B>=0;B--){for(var D=0,C=n.length;D<C;D++){if(d.value[B]===n[D]){return false}}}return true},x=function(C){try{C.focus();if(C.selectionStart>=0){return C.selectionStart}if(document.selection){var B=document.selection.createRange();return -B.moveStart("character",-C.value.length)}return -1}catch(D){return -1}},b=function(C,E){try{if(C.selectionStart){C.focus();C.setSelectionRange(E,E)}else{if(C.createTextRange){var B=C.createTextRange();B.move("character",E);B.select()}}}catch(D){return false}return true},m=function(D){D=D||window.event;var C="",E=D.which,B=D.type;if(E===undefined||E===null){E=D.keyCode}if(E===undefined||E===null){return""}switch(E){case 8:C="bksp";break;case 46:C=(B==="keydown")?"del":".";break;case 16:C="shift";break;case 0:case 9:case 13:C="etc";break;case 37:case 38:case 39:case 40:C=(!D.shiftKey&&(D.charCode!==39&&D.charCode!==undefined))?"etc":String.fromCharCode(E);break;default:C=String.fromCharCode(E);break}return C},v=function(B,C){if(B.preventDefault){B.preventDefault()}B.returnValue=C||false},k=function(B){var D=x(d),F=d.value,E="",C=true;switch(C){case (i.indexOf(B)!==-1):D=D+1;if(D>s.length){return false}while(p.indexOf(F.charAt(D-1))!==-1&&D<=s.length){D=D+1}if(!h(B,D)){c(B);return false}E=F.substr(0,D-1)+B+F.substr(D);if(i.indexOf(F.charAt(D))===-1&&n.indexOf(F.charAt(D))===-1){D=D+1}break;case (B==="bksp"):D=D-1;if(D<0){return false}while(i.indexOf(F.charAt(D))===-1&&n.indexOf(F.charAt(D))===-1&&D>1){D=D-1}E=F.substr(0,D)+s.substr(D,1)+F.substr(D+1);break;case (B==="del"):if(D>=F.length){return false}while(p.indexOf(F.charAt(D))!==-1&&F.charAt(D)!==""){D=D+1}E=F.substr(0,D)+s.substr(D,1)+F.substr(D+1);D=D+1;break;case (B==="etc"):return true;default:return false}d.value="";d.value=E;b(d,D);return false},g=function(B){if(i.indexOf(B)===-1&&B!=="bksp"&&B!=="del"&&B!=="etc"){var C=x(d);y=true;c(B);setTimeout(function(){y=false;b(d,C)},w);return false}return true},z=function(C){if(!l){return true}C=C||event;if(y){v(C);return false}var B=m(C);if((C.metaKey||C.ctrlKey)&&(B==="X"||B==="V")){v(C);return false}if(C.metaKey||C.ctrlKey){return true}if(d.value===""){d.value=s;b(d,0)}if(B==="bksp"||B==="del"){k(B);v(C);return false}return true},e=function(C){if(!l){return true}C=C||event;if(y){v(C);return false}var B=m(C);if(B==="etc"||C.metaKey||C.ctrlKey||C.altKey){return true}if(B!=="bksp"&&B!=="del"&&B!=="shift"){if(!g(B)){v(C);return false}if(k(B)){if(u()){q()}v(C,true);return true}if(u()){q()}v(C);return false}return false},r=function(){if(!d.tagName||(d.tagName.toUpperCase()!=="INPUT"&&d.tagName.toUpperCase()!=="TEXTAREA")){return null}if(!A||d.value===""){d.value=s}j(d,"keydown",function(B){z(B)});j(d,"keypress",function(B){e(B)});j(d,"focus",function(){t=d.value});j(d,"blur",function(){if(d.value!==t&&d.onchange){d.onchange()}});return o};o.resetField=function(){d.value=s};o.setAllowed=function(B){i=B;o.resetField()};o.setFormat=function(B){s=B;o.resetField()};o.setSeparator=function(B){p=B;o.resetField()};o.setTypeon=function(B){n=B;o.resetField()};o.setEnabled=function(B){l=B};return r()}}(window));

 

https://codepen.io/_marcba/pen/JjXRNbV

<label>IP Address</label>
<input type="text" class="form-input" id="ipv4" name="ipv4" placeholder="xxx.xxx.xxx.xxx"/>
//input mask bundle ip address
var ipv4_address = $('#ipv4');
ipv4_address.inputmask({
    alias: "ip",
    greedy: false //The initial mask shown will be "" instead of "-____".
});
반응형
반응형

{...{id:1,value:일},id:2} ->뒤에 오는 2를 사용함, 앞에 위치한 값은 없어짐

뒤가 중요

반응형
반응형

진입방법

  • 바탕화면 > 마우스오른쪽버튼 > 디스플레이 설정 > 야간모드 설정
  • 윈도우키 > 설정 > 디스플레이 > 야간모드 설정
  • 작업표시줄 끝 말풍선 > 야간모드 > 마우스오른쪽버튼 > 설정으로 이동 > 야간모드 설정
반응형
반응형
반응형
반응형
Intl.NumberFormat().format(n.cost)

 

    function numberWithCommas(str) {
        // console.log(str)
        // 주어진 문자열이 숫자로만 구성되어 있는지 확인합니다.
        const isNumeric = /^\d+$/.test(str);
   
        // 숫자로만 구성되어 있을 경우에만 변환합니다.
        if (isNumeric) {
            // 숫자의 길이를 구합니다.
            const length = str.length;
   
            // 숫자의 길이가 4 이상이면, 통화 구분 기호를 넣습니다.
            if (length >= 4) {
                return str.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
            }
   
            // 숫자의 길이가 4 미만이면, 통화 구분 기호를 넣지 않습니다.
            return str;
        }
   
        // 숫자로만 구성되어 있지 않으면 그대로 반환합니다.
        return str;
    }
반응형
반응형

runDev.bat

set JAVA_HOME=%CD%\java\zulu-11
set path=%JAVA_HOME%\bin;%PATH%;
set classpath=.

cd sts-4.13.0.RELEASE

SpringToolSuite4.exe
반응형

'java, spring' 카테고리의 다른 글

400Bad Request: 필수파라미터 누락 등의 에러, 삽질방지위해서는 에러메세지 잘보자!  (0) 2024.01.19
java stream  (0) 2022.04.28
Quartz  (0) 2022.04.19
Tomcat's directories  (0) 2021.03.03
Java Web Application  (0) 2021.03.02
반응형

- 보통 서버에서는 request size 1MB이 걸려있는 경우가 많음 

new File([imgFile.slice(chunkIndex * chunkSize, (chunkIndex + 1) * chunkSize)], imgFile.name)

- 위와 같이 하면 파일을 잘라서 분리가능

- 보낼때는 async await써서 순차적으로 보내지도록 해야함 

[js 소스]

const resultUrl = await uploadChunk(other.imgFile);
  const uploadChunk = async (imgFile) => {
    one.activeDimLayer(true);
    const chunkSize = 1024 * 1023
    const totalChunk = imgFile.size % chunkSize == 0 ? imgFile.size / chunkSize : Math.floor(imgFile.size / chunkSize) + 1;
    const path = window.location.search.split('=')[1] + '_' + window.location.pathname.split('/').pop() + '/' + (new Date()).getFullYear() + '/' + ((new Date()).getMonth() + 1).toString().padStart(2, '0') + '/'
    let chunkIndex = -1;
    let resultUrl;

    while (chunkIndex < totalChunk - 1) {
      chunkIndex += 1;
      let chunk = new File([imgFile.slice(chunkIndex * chunkSize, (chunkIndex + 1) * chunkSize)], imgFile.name);
      //console.log('chunk', chunk);
      const body = new FormData();
      body.append('DetailPath', '/' + path);
      body.append('totalChunk', totalChunk);
      body.append("chunkIndex", chunkIndex);
      body.append('UploadFiles', chunk);

      await fetch('api/farmos/files/manual/upload/' + path,
        { method: "post", headers: { Authorization: 'Bearer ' + localStorage.getItem('token') }, body })
        .then((res => {//console.log('res', res);
          if (res.status === 200) return res.json()
          else if (res.status === 206);
          else chunkIndex = totalChunk
        }))
        .then(res => { if (res?.filepath && res?.filename) resultUrl = window.origin + '/api/farmos/files/manual/download' + res.filepath + res.filename })
        .catch(err => {
          console.log('imgUploadError', err);
          chunkIndex = totalChunk
        });
    }
    one.activeDimLayer(true);
    return resultUrl;
  }

 

[java 소스]

    @ResponseBody
    @PostMapping(value = "/files/manual/upload/{menu}/{year}/{month}/")    
    public ResponseEntity<?> chunkUpload(@RequestParam("UploadFiles") MultipartFile file,
                                              @RequestParam(value = "chunkIndex", required = false, defaultValue = "0") int chunkIndex,
                                              @RequestParam(value = "totalChunk", required = false, defaultValue = "1") int totalChunk,
                                              @PathVariable String menu, 
                                              @PathVariable String year, 
                                              @PathVariable String month, 
                                              HttpServletRequest request 
     ) throws IOException {
     String screenDetailPath =  '/' + filterInjectedString(menu) + '/' + filterInjectedString(year) + '/' + filterInjectedString(month) + '/';
     Map<String, Object> resultFileStatus = mdmManualRule.chunkUpload(file, screenDetailPath, chunkIndex, totalChunk);
        boolean isDone = (boolean) resultFileStatus.get("status"); 
        if (isDone) {
//         String filename = resultFileStatus.get("filename").toString();
         return ResponseEntity.ok().body(resultFileStatus);
        } else {
         return ResponseEntity.status(HttpStatus.PARTIAL_CONTENT).build();
        } 
    }

@SuppressWarnings("unchecked")
    public Map<String, Object> chunkUpload(MultipartFile file, String screenDetailPath, int chunkIndex, int totalChunk) throws IOException {
     // 파일 업로드 위치
        String uploadDir;
        String os = System.getProperty("os.name").toLowerCase();
        if (os.contains("win")) {
            // System.out.println("Windows");
         uploadDir = "C:";
        } else {
     // System.out.println("ubuntu");
     uploadDir = "";
    }
        
        if (uploadPath == null) {
         uploadPath = "/app/WAS/FARMOS/uploadfile";
        }

        uploadDir = uploadDir + uploadPath + screenDetailPath;

        File dir = new File(uploadDir);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        if (os.contains("win")) {
         uploadDir = uploadDir.replaceAll("/", "\\\\");
        }
        String seperator;
        if (os.contains("win")) {
         seperator = "/";
        } else {
         seperator = "\\";
        }

// 임시 저장 파일 이름
        String filename = file.getOriginalFilename() + ".part" + chunkIndex;

        Path filePath = Paths.get(uploadDir, filename);
        // 임시 저장
        Files.write(filePath, file.getBytes());
        Map<String, Object> result = new HashMap<String, Object>();
// 마지막 조각이 전송 됐을 경우
        if (chunkIndex == totalChunk-1) {
            String[] split = file.getOriginalFilename().split("\\.");
            String outputFilename = UUID.randomUUID() + "." + split[split.length-1];
            // need file duplication check in while ?
            
            Path outputFile = Paths.get(uploadDir, outputFilename);
            Files.createFile(outputFile);
            
            // merge temp file
            for (int i = 0; i < totalChunk; i++) {
                Path chunkFile = Paths.get(uploadDir, file.getOriginalFilename() + ".part" + i);
                Files.write(outputFile, Files.readAllBytes(chunkFile), StandardOpenOption.APPEND);
                // delete temp file
                Files.delete(chunkFile);
            }
            log.info("File uploaded successfully");
            result.put("filename", outputFilename);
            result.put("filelabel", file.getOriginalFilename());
            result.put("filepath", screenDetailPath);
            result.put("status", true);
            return result;
        } else {
         result.put("status", false);
            return result;
        }
    }

 

반응형

+ Recent posts