vendredi 8 juillet 2016

No adapter for handler [controller.EditController]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler

can someone help me what is the problem with my code here ... the project was working fine but now it has stopped worked and with every post its showing this error

Blockquote

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <props>                
            <prop key="index.htm">indexController</prop>
        </props>
    </property>
</bean>

<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/"
      p:suffix=".jsp" />


<bean name="indexController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="index" />

<context:component-scan base-package="com.controller" />

@Controller
@RequestMapping("/edit")
public class EditController {

    @RequestMapping(value = "/edit/{id}", method = RequestMethod.GET)
    public String EditEmployee(@PathVariable("id")int id, Model model,HttpServletRequest request, HttpServletResponse response){        

            //   Send to edit pate
            Employees e = userviewmodel.GetEmployee(id);        
            model.addAttribute("employee",e);
            return "edit"; 
    }
}

Aucun commentaire:

Enregistrer un commentaire