package Ġcom . ying ta oh uo . web Ċ Ċ /** Ċ Ġ* Ġä½ľèĢħ : Ġy in ch ang sh eng @ gmail . com Ċ Ġ* ĠåĪĽå»º äºİ : Ġ 2 0 1 7 / 9 / 2 Ċ Ġ* Ġ å¾®ä¿¡ : Ġy in 8 0 8 7 1 9 0 1 Ċ Ġ*/ Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . web . servlet . config . annotation . Enable Web Mvc Ċ import Ġorg . springframework . web . servlet . config . annotation . Resource Handler Registry Ċ import Ġorg . springframework . web . servlet . config . annotation . ViewController Registry Ċ import Ġorg . springframework . web . servlet . config . annotation . Web Mvc Configurer Adapter Ċ Ċ @ Configuration Ċ @ Enable Web Mvc Ċ class ĠWeb Config Ġ: ĠWeb Mvc Configurer Adapter () Ġ{ ĊĊĠĠĠ Ġprivate Ġval ĠCL AS SPATH _ RESOURCE _ LOCATION S Ġ= ĠarrayOf (" classpath :/ META - INF / resources /", Ġ" classpath :/ resources /", Ġ" classpath :/ static /", Ġ" classpath :/ public /") ĊĊĠĠĠ Ġoverride Ġfun Ġadd View Controllers ( registry : ĠView Controller Registry ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// registry . add Redirect ViewController ("/", Ġ"/ items / list ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġadd Resource Handlers ( registry : ĠResource Handler Registry ) Ġ{ ĊĠĠĠĠĠĠĠ Ġregistry . add Resource Handler (" /** "). add Resource Locations (* CLAS SPATH _ RESOURCE _ LOCATION S ) ĊĠĠĠ Ġ} Ċ Ċ }