spring - How to use <mvc:resource/> in Groovy -
i want use <mvc:resource/>
such <mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/resources/**" location="/resources/" />
in context-mvc.groovy
,and not know how write.help me~
import org.springframework.web.servlet.view.internalresourceviewresolver beans { xmlns context: "http://www.springframework.org/schema/context" context."component-scan"("base-package" : "com.oberon.fm") viewresolver(internalresourceviewresolver) { prefix = "/pages/" suffix = ".jsp" } }
in order use mvc namespace in groovy, need add the xmlns
.
then can use context one.
beans { xmlns([ctx:'http://www.springframework.org/schema/context', mvc:'http://www.springframework.org/schema/mvc']) ctx.'component-scan'('base-package': "com.oberon.fm") mvc.resources(mapping:"/images/**", location:"/images/") mvc.resources(mapping:"/resources/**", location:"/resources/") }
Comments
Post a Comment