samedi 19 mai 2018

How to map .jsp file inside two to three sub folder using spring mvc annotation

Here i am facing one problem related spring mvc my code is to map multiple .jsp file inside WEB-INF file the Code is
WebMvcConfig.java

@Bean
    public UrlBasedViewResolver setupViewResolver() {
        UrlBasedViewResolver resolver = new UrlBasedViewResolver();
        resolver.setPrefix("/WEB-INF/views/");

        resolver.setSuffix(".jsp");
        resolver.setViewClass(JstlView.class);
        return resolver;


    }

demoController.java

@RequestMapping(value = "test3/{groupId}/{fileType}", method = RequestMethod.GET)
    @ResponseBody
    public final void getUserOrdersCSV(@PathVariable final int groupId, @PathVariable final String fileType, HttpServletResponse response) {
        if(SessionUtil.getUserFromSession() != null) {
            final User user = userService.getUser(SessionUtil.getUserFromSession().getUserId());
            final List<OrderViewModel> orderList = (user.getRole() == UserRole.Admin? orderService.getByBidUserId(user.getUserId()) : orderService.getByUser(user))
                    .stream().filter(order -> order.getQty().getGroup().getGroupId() == groupId).map(OrderViewModel::new)
                    .sorted((order1, order2) -> Integer.compare(order1.getCustomerId(), order2.getCustomerId())).collect(Collectors.toList());

like when run project i am getting 404 resource not found.enter image description here how to fix this issue please help me little bit struck




Aucun commentaire:

Enregistrer un commentaire