我们可以在Spring Boot中更新HandlerInterceptor的PostHandel上的数据库吗?

时间:2018-12-26 14:04:34

标签: spring-boot jpa interceptor

这是我正在使用# Define the input as a tensor with shape input_shape X_input = Input(input_shape) # Zero_Padding X = ZeroPadding2D((3,3))(X_input) #stage_1 X = Conv2D(64,(7,7),strides = (2,2),name = 'conv1')(X) X = BatchNormalization(axis = 3,name = 'bn_conv1')(X) X = Activation('relu')(X) X = MaxPooling2D((3,3),strides = (2,2))(X) # Stage 2 X = convolutional_block(X, f = 3, filters = [64, 64, 256], stage = 2, block='a', s = 1) X = identity_block(X, 3, [64, 64, 256], stage=2, block='b') X = identity_block(X, 3, [64, 64, 256], stage=2, block='c') #stage3 X = convolutional_block(X,f = 3 , filters = [128,128,512],stage = 3,block = 'a', s = 2) X = identity_block(X,3,[128,128,512],stage = 3,block='b') X = identity_block(X,3,[128,128,512],stage = 3 , block = 'c') X = identity_block(X,3,[128,128,512],stage = 3 , block = 'd') #stage 4 X = convolutional_block(X,f = 3 , filters = [256,256,1024],stage = 4,block = 'a', s = 2) X = identity_block(X,3,[256,256,1024],stage = 4,block='b') X = identity_block(X,3,[256,256,1024],stage = 4,block='c') X = identity_block(X,3,[256,256,1024],stage = 4,block='d') X = identity_block(X,3,[256,256,1024],stage = 4,block='e') X = identity_block(X,3,[256,256,1024],stage = 4,block='f') X = identity_block(X,3,[256,256,1024],stage = 4,block='g') X = identity_block(X,3,[256,256,1024],stage = 4,block='h') X = identity_block(X,3,[256,256,1024],stage = 4,block='i') X = identity_block(X,3,[256,256,1024],stage = 4,block='j') X = identity_block(X,3,[256,256,1024],stage = 4,block='k') X = identity_block(X,3,[256,256,1024],stage = 4,block='l') #stage 5 X = convolutional_block(X,f = 3 , filters = [512,512,2048],stage = 5,block = 'a', s = 2) X = identity_block(X,3,[512,512,2048],stage = 5,block='b') X = identity_block(X,3,[512,512,2048],stage = 5,block='c') # AVGPOOL X = Conv2D(3,kernel_size=(3,3), padding = 'same',use_bias = False)(X) X = UpSampling2D(size=2)(X) X = UpSampling2D(size=2)(X) X = UpSampling2D(size=2)(X) X = UpSampling2D(size=2)(X) X = UpSampling2D(size=2)(X) # Create model model = Model(inputs = X_input, outputs = X) return(model) 的{​​{1}}。 对于每个ADD URL,我将其称为拦截器。在此拦截器中,我已经自动连接了HandlerInterceptor,其中有用于Mongo数据库写入的JPA存储库。但是我在“ logTraceServer”类成员上得到了空指针错误。

我想在每次保存时写入mongo DB。这就是为什么我写这堂课。

postHandle

=====================================

@配置 公共类AppConfig实现WebMvcConfigurer {

LogTraceService

}

注意-我的Interceptor完美无缺,但它却是自动连线的,但问题是我得到的“ logTraceService”为空。

0 个答案:

没有答案