Announcement Announcement Module
Collapse
No announcement yet.
bad controller config? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • bad controller config?

    hi

    i have problem with a controller

    Code:
    @Controller
    public class UserController {
        
        @Autowired    
        private IUserService userService;    
        
        @RequestMapping("/hebdomadaire")
        public ModelAndView hebdomadaire() {
            
            ModelAndView modelAndView = new ModelAndView("stats");
            modelAndView.addObject("stats", userService.getStatistique());
    
            return modelAndView;
        }
    when i'm debugging, i see the value of getStatistique


    in my jsp
    Code:
    ${stats.total}
    my dispatch-servlet

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/aop 
           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/context 
           http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/mvc 
    	   http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
    
    <context:component-scan base-package="com.h3v.*"/>
    <context:annotation-config/>
    
        
    <mvc:annotation-driven />
    
    <bean id="viewResolver"
           class="org.springframework.web.servlet.view.InternalResourceViewResolver"
           p:prefix="/WEB-INF/jsp/"
           p:suffix=".jsp" />
    i get a 404 error, any idea?

    thanks
Working...
X