I faced a problem ,It doesn't redirect to a jsp(HTTP 404) by the controller although I entered correctly a valid url address that can be treated by the controller . Here are my web.xml , the controller and what the debugger shows me. web.xml I entered http://localhost:8080/AccessControl/produits.aspx
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://ift.tt/ra1lAU" xmlns="http://ift.tt/nSRXKP" xmlns:web="http://ift.tt/LU8AHS" xsi:schemaLocation="http://ift.tt/nSRXKP http://ift.tt/LU8AHS" id="WebApp_ID" version="2.5">
<display-name>ApplicationAccessControl</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-beans.xml</param-value>
</context-param>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/application-servlet-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.aspx</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>default.aspx</welcome-file>
</welcome-file-list>
</web-app>
agentadministrative.java in the controller package
package controller;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import dao.AgentAdministrative;
import services.AgentAdministrativeMetier;
import services.SessionBean;
public class AgentAdministrativeController {
@Autowired
AgentAdministrativeMetier services;
@Autowired
private SessionBean sessionBean;
@RequestMapping(value={"/connnexiontrait","/default"})
public String verifier(Model model,@RequestParam String username,@RequestParam String motdepasse,@RequestParam int labo){
Long t;
String arg1;
t=services.verifaccess(username, motdepasse, labo);
if (t.intValue()==0)
{
arg1="Nom d'utilisateur ou mot de passe ou numero de laboratoire sont incorrectes ,veuillez les ressaisir " ;
model.addAttribute("erreurs", arg1);
System.out.println("succes");
return "connexion";
}
else
{
System.out.println("succes");
return "produits";
}
}
@RequestMapping(value={"/produits"})
public String verifie(Model model)
{
return "produits";
}
}
what the debugger shows me
mars 29, 2015 8:32:12 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
AVERTISSEMENT: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:AccessControl' did not find a matching property.
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server version: Apache Tomcat/8.0.20
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server built: Feb 15 2015 18:10:42 UTC
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server number: 8.0.20.0
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Name: Linux
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Version: 3.16.0-23-generic
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Architecture: i386
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Java Home: /usr/lib/jvm/java-7-openjdk-i386/jre
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Version: 1.7.0_75-b13
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Vendor: Oracle Corporation
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_BASE: /home/sami/workspace/.metadata/.plugins/http://ift.tt/1BglHyI
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_HOME: /home/sami/Téléchargements/apache-tomcat-8.0.20
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.base=/home/sami/workspace/.metadata/.plugins/http://ift.tt/1BglHyI
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.home=/home/sami/Téléchargements/apache-tomcat-8.0.20
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dwtp.deploy=/home/sami/workspace/.metadata/.plugins/http://ift.tt/1pvLkUI
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Djava.endorsed.dirs=/home/sami/Téléchargements/apache-tomcat-8.0.20/endorsed
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dfile.encoding=UTF-8
mars 29, 2015 8:32:12 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFOS: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386:/usr/lib/jvm/java-7-openjdk-i386/jre/../lib/i386:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/client:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386::/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib
mars 29, 2015 8:32:12 AM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-nio-8080"]
mars 29, 2015 8:32:12 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
mars 29, 2015 8:32:12 AM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["ajp-nio-8009"]
mars 29, 2015 8:32:12 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
mars 29, 2015 8:32:12 AM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 885 ms
mars 29, 2015 8:32:12 AM org.apache.catalina.core.StandardService startInternal
INFOS: Démarrage du service Catalina
mars 29, 2015 8:32:12 AM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet Engine: Apache Tomcat/8.0.20
mars 29, 2015 8:32:14 AM org.apache.catalina.core.ApplicationContext log
INFOS: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
hibernate framework !!
mars 29, 2015 8:32:15 AM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["http-nio-8080"]
mars 29, 2015 8:32:15 AM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["ajp-nio-8009"]
mars 29, 2015 8:32:15 AM org.apache.catalina.startup.Catalina start
INFOS: Server startup in 2937 ms
mars 29, 2015 8:32:58 AM org.apache.catalina.core.ApplicationContext log
INFOS: Initializing Spring FrameworkServlet 'action'
Please help
Aucun commentaire:
Enregistrer un commentaire