17 lines
447 B
Java
17 lines
447 B
Java
|
|
package com.blog.initialization;
|
||
|
|
|
||
|
|
import com.blog.context.GlobalContext;
|
||
|
|
import com.blog.holder.GlobalContextHolder;
|
||
|
|
import jakarta.annotation.PostConstruct;
|
||
|
|
import org.springframework.stereotype.Component;
|
||
|
|
|
||
|
|
@Component
|
||
|
|
public class GlobalContextInitialization {
|
||
|
|
|
||
|
|
@PostConstruct
|
||
|
|
public void initGlobalContext(){
|
||
|
|
GlobalContext globalContext = new GlobalContext();
|
||
|
|
GlobalContextHolder.setGlobalContext(globalContext);
|
||
|
|
}
|
||
|
|
}
|