I have spring project with web.xml configuration
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Here is my servlet-context.xml
resources location="/, classpath:/META-INF/web-resources/" mapping="/resources/**" />
<default-servlet-handler/>
<context:component-scan base-package="pk.training.basitMahmood.web.controller" />
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jspx" />
</beans:bean>
Here is my controller
@RequestMapping("/contacts")
@Controller
public class ContactController {
final Logger logger = LoggerFactory.getLogger(ContactController.class);
@Autowired
private ContactService contactService;
@RequestMapping(method = RequestMethod.GET)
public String list(Model uiModel) {
logger.info("Listing contacts");
List<Contact> contacts = contactService.findAll();
uiModel.addAttribute("contacts", contacts);
logger.info("No. of contacts: " + contacts.size());
return "contacts/list";
}
} //end of class ContactController
Now when i select run on server then i get the following page

But when i change the url to http://localhost:9090/ch17_i18nSupport/contacts then i get the error that

I have list.jspx in my contacts folder. Why i am getting not found error?
Thanks
<bean name="/contacts" class="pk.training.(...).ContactController"></bean>?import pk.training.basitMahmood.domain.Contact; import pk.training.basitMahmood.service.ContactService;but code says unresolve imports, don't know why ...<annotation-driven />tag in myservlet-context.xml. Now everything is working fine :)No adapter for handlerindicates that the@RequestMappingmethods in your controller aren't being picked up. Do you have a<mvc:annotation-driven />tag in your servlet-context.xml?