0
我收到一个错误,提示“所请求的资源不可用”,尽管它看起来像所有的RequestMappings都可以。你能帮我理解并解决问题吗?请求的资源不可用。 Spring RequestMapping
控制器类
@Controller
@RequestMapping("/products")
public class ProductController {
@Autowired
private ProductService productService;
@RequestMapping
public String list(Model model) {
model.addAttribute("products", productService.getAllProducts());
return "products";
}
@RequestMapping("/all")
public String allProducts(Model model) {
model.addAttribute("products", productService.getAllProducts());
return "products";
}
}
如果我输入//网络存储器/产品它的工作原理确定。视图正确解析并显示页面。
但是,如果我输入// webstore/products/all并且发生错误:“请求的资源不可用”。
的路径似乎是错误的:/webstore/products/WEB-INF/views/products.jsp
我觉得应该是:/webstore/WEB-INF/views/products.jsp
你能告诉我们你的web.xml和弹簧配置吗? – nebula 2014-12-07 14:48:17
@nebula当然。 web.xml http://codepaste.net/5b22d5 Spring上下文:http://codepaste.net/fgrwau – Lemohewe 2014-12-07 16:40:14