this is my web.xml file
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<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-patte>/</url-patte>
</servlet-mapping>
and this is My servlet-Context.xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC @Controller programming model -->
<aotation-driven />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.IntealResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.site.aonce" />
</beans:beans>
**and this is my first controller **
package com.site.aonce.controlleur;
import org.springframework.beans.factory.aotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.aotation.RequestMapping;
import org.springframework.web.bind.aotation.SessionAttributes;
import com.site.aonce.entities.Role;
import com.site.aonce.metier.IadminMetier;
@Controller
@SessionAttributes("editedRole")
@RequestMapping(value="/adminRole")
public class AdminRoleControlleur {
@Autowired
private IadminMetier metier;
@RequestMapping(value="/indexRole")
String addRole(Model model){
model.addAttribute("role", new Role());
model.addAttribute("roles", metier.listRoles());
retu "role";
}
}
and this is my second Controller
@Controller
@RequestMapping(value="/adminCat")
@SessionAttributes("edited")
public class AdminCategorieControlleur implements HandlerExceptionResolver{
@Autowired
private IadminMetier metier;
@RequestMapping(value="/indexCat")
String addCategorie(Model model){
model.addAttribute("categorie",new Categorie());
model.addAttribute("categories", metier.listCategories());
retu "categorie";
}
My probleme is when i put http://localhost:8080/aonce/adminRole/indexRole he dont retu role.jsp but he retu categorie.jsp
