spring - Is there any analog of XML resources mapping for Java based configuration? -


my problem related access resources. more specific jsp couldn't access js , css (resources). there analog of xml tag <mvc:resources mapping="/resources/**" location="/web-inf/resources/"/> java based configuration?

my configuration class

@enablewebmvc @configuration @componentscan("com.springapp.mvc") @propertysource("classpath:names.properties") public class webmvcconfig extends webmvcconfigureradapter {      @bean     public internalresourceviewresolver setupviewresolver() {         internalresourceviewresolver resolver = new internalresourceviewresolver();         resolver.setprefix("/web-inf/pages/");         resolver.setsuffix(".jsp");         return resolver;     }      // other beans } 

founded! need add method config class.

@override public void addresourcehandlers(resourcehandlerregistry registry) {     registry.addresourcehandler("/resources/**").addresourcelocations("/web-inf/resources/"); } 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -