我想使用spring调用/ WEB-INF / lib下jar中的home.html文件。
以下是配置类
@Configuration
@ComponentScan("com.barclays.mobile.gateway.controller")
@EnableWebMvc
public class MvcConfig extends WebMvcConfigurerAdapter{
@Bean(name = "viewResolver")
public InternalResourceViewResolver getViewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/WEB-INF/");
viewResolver.setSuffix(".html");
return viewResolver;
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/component/**").addResourceLocations("classpath:/app/component/*");
registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/app/assets/*");
registry.addResourceHandler("/home/**").addResourceLocations("classpath:/app/*");
}
}
以下是控制器:
@Controller
public class StaffController {
@RequestMapping(value = "/home", method = RequestMethod.GET)
public String home() {
return "home";
}
}
请建议如何操作。?
答案 0 :(得分:0)
从/home
删除<a href="http://myserver.com/sendmail?to=me@home.com&from=you@home.com&subject=hello&body=something> Send an email </a>
,我想这就是问题