freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

springboot學(xué)習(xí)資料-資料下載頁

2025-07-14 16:11本頁面
  

【正文】 rtifactIdspringbootstarteraop/artifactId /dependency@Aspect@Componentpublic class WebLogAspect { private Logger logger = (getClass())。 @Pointcut(execution(public * ..*.*(..))) public void webLog() { } @Before(webLog()) public void doBefore(JoinPoint joinPoint) throws Throwable { // 接收到請求,記錄請求內(nèi)容 ServletRequestAttributes attributes = (ServletRequestAttributes) ()。 HttpServletRequest request = ()。 // 記錄下請求內(nèi)容 (URL : + ().toString())。 (HTTP_METHOD : + ())。 (IP : + ())。 EnumerationString enu = ()。 while (()) { String name = (String) ()。 (name:{},value:{}, name, (name))。 } } @AfterReturning(returning = ret, pointcut = webLog()) public void doAfterReturning(Object ret) throws Throwable { // 處理完請求,返回內(nèi)容 (RESPONSE : + ret)。 }}七、 緩存支持 pom文件引入dependencygroupId/groupIdartifactIdspringbootstartercache/artifactId/dependency 文件?xml version= encoding=UTF8?ehcache xmlns:xsi= xsi:noNamespaceSchemaLocation= updateCheck=false diskStore path= / ! 默認(rèn)配置 defaultCache maxElementsInMemory=5000 eternal=false timeToIdleSeconds=120 timeToLiveSeconds=120 memoryStoreEvictionPolicy=LRU overflowToDisk=false / cache name=baseCache maxElementsInMemory=10000 maxElementsOnDisk=100000 //ehcache配置信息介紹1. !2. name:緩存名稱。3. maxElementsInMemory:緩存最大個數(shù)。4. eternal:對象是否永久有效,一但設(shè)置了,timeout將不起作用。5. timeToIdleSeconds:設(shè)置對象在失效前的允許閑置時間(單位:秒)。僅當(dāng)eternal=false對象不是永久有效時使用,可選屬性,默認(rèn)值是0,也就是可閑置時間無窮大。6. timeToLiveSeconds:設(shè)置對象在失效前允許存活時間(單位:秒)。最大時間介于創(chuàng)建時間和失效時間之間。僅當(dāng)eternal=false對象不是永久有效時使用,默認(rèn)是0.,也就是對象存活時間無窮大。7. overflowToDisk:當(dāng)內(nèi)存中對象數(shù)量達(dá)到maxElementsInMemory時,Ehcache將會對象寫到磁盤中。8. diskSpoolBufferSizeMB:這個參數(shù)設(shè)置DiskStore(磁盤緩存)的緩存區(qū)大小。默認(rèn)是30MB。每個Cache都應(yīng)該有自己的一個緩沖區(qū)。9. maxElementsOnDisk:硬盤最大緩存?zhèn)€數(shù)。10. diskPersistent:是否緩存虛擬機(jī)重啟期數(shù)據(jù)WhetherthediskstorepersistsbetweenrestartsoftheVirtualMachine.Thedefaultvalueisfalse.11. diskExpiryThreadIntervalSeconds:磁盤失效線程運(yùn)行時間間隔,默認(rèn)是120秒。12. memoryStoreEvictionPolicy:當(dāng)達(dá)到maxElementsInMemory限制時,Ehcache將會根據(jù)指定的策略去清理內(nèi)存。默認(rèn)策略是LRU(最近最少使用)。你可以設(shè)置為FIFO(先進(jìn)先出)或是LFU(較少使用)。13. clearOnFlush:內(nèi)存數(shù)量最大時是否清除。14. @CacheConfig(cacheNames = baseCache)public interface UserMapper { @Select(select * from users where name={name}) @Cacheable UserEntity findName(@Param(name) String name)。}@Autowiredprivate CacheManager cacheManager。@RequestMapping(/remoKey)public void remoKey() { (baseCache).clear()。}使用Redis做集中式緩存八、 其他內(nèi)容、使用@Scheduled創(chuàng)建定時任務(wù)在Spring Boot的主類中加入@EnableScheduling注解,啟用定時任務(wù)的配置@Componentpublic class ScheduledTasks { private static final SimpleDateFormat dateFormat = new SimpleDateFormat(HH:mm:ss)。 @Scheduled(fixedRate = 5000) public void reportCurrentTime() { (現(xiàn)在時間: + (new Date()))。 }}、使用@Async實現(xiàn)異步調(diào)用啟動加上@EnableAsync ,需要執(zhí)行異步方法上加入 @Async、自定義參數(shù)配置文件值name=配置文件值 @Value(${name}) private String name。@ResponseBody @RequestMapping(/getValue) public String getValue() { return name。 }、多環(huán)境配置=pre:開發(fā)環(huán)境:測試環(huán)境:生產(chǎn)環(huán)境、修改端口號=8888 =/itmayiedu、SpringBoot yml 使用server: port: 8090 contextpath: /itmayiedu、發(fā)布打包使用mvn clean清除以前的編譯文件使用mvn package 打包使用java –jar 包名如果報錯沒有主清單,在pom文件中新增 build plugins plugin groupId/groupId artifactIdmavenpilerplugin/artifactId configuration source/source target/target /configuration /plugin plugin groupId/groupId artifactIdspringbootmavenplugin/artifactId configuration maimClass/maimClass /configuration executions execution goals goalrepackage/goal /goals /execution /executions /plugin /plugins /build
點(diǎn)擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1