spring mvc servlet initialization

前端 未结 2 853
有刺的猬
有刺的猬 2020-12-14 13:04

I am new to spring MVC. I am looking for a place in my spring mvc applicationwhere I can initialize all sorts of things in the application. usually I did that in the init()

2条回答
  •  情歌与酒
    2020-12-14 13:37

    All beans can have an init-method. See the documentation. I suppose that the best practice will be to use this method for every bean you define. A bean can have references to other beans if this is required.

提交回复
热议问题