Bonjour
je suis débutant en JEE et en Frameworks
j'ai essayé de déployer un premier programme Struts sous JBoss et avec eclipse mais j'ai rencontré l'erreur suivante:
note La trace compl�te de la cause m�re de cette erreur est disponible dans les fichiers journaux de JBoss Web/2.1.1.GA.Etat HTTP 500 -
type Rapport d'exception
message
description Le serveur a rencontr� une erreur interne () qui l'a emp�ch� de satisfaire la requ�te.
exception
org.apache.jasper.JasperException: java.lang.NullPointerException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
cause m�re
java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
org.apache.jsp.pages.authentificationForm_jsp._jspx_meth_html_005fform_005f0(authentificationForm_jsp.java:150)
org.apache.jsp.pages.authentificationForm_jsp._jspx_meth_html_005fhtml_005f0(authentificationForm_jsp.java:106)
org.apache.jsp.pages.authentificationForm_jsp._jspService(authentificationForm_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
JBoss Web/2.1.1.GA
Mon fichier struts-config est le suivant:
Mon fichier web.xml:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <struts-config> <form-beans> <form-bean name="authentificationForm" type="actionform.AuthentificationForm"/> </form-beans> <global-exceptions></global-exceptions> <global-forwards></global-forwards> <action-mappings> <action path="/Authentification" type="action.AuthentificationAction" name="authentificationForm" scope = "request" input="/WebContent/pages/authentificationForm.jsp"> <forward name="erreurs" path="/WebContent/pages/Erreurs.jsp"/> <forward name="succes" path="/WebContent/pages/succes.jsp"/> </action> </action-mappings> </struts-config>
mon formulaire jsp:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>installationstruts</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>WebContent/pages/authentificationForm.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WebContent/WEB-INF/struts-config.xml</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> </web-app>
Ma classe action:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html:html> <head> <title>Authentification</title> <html:base/> </head> <body> <html:form action="Authentification.do"> Identifiant : <html:text property="identifiant"/><br/> Mot de passe : <html:text property="motdepasse"/><br/> <html:submit value="Envoyer"/> </html:form> </body> </html:html>
et enfin mon beans actionForm:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package action; import javax.servlet.http.*; import org.apache.struts.action.*; import actionform.AuthentificationForm; public class AuthentificationAction extends Action { public ActionForward execute(HttpServlet request, HttpServlet response, ActionMapping mapping,ActionForm form) { AuthentificationForm authentificationForm = (AuthentificationForm) form; if (authentificationForm.getIdentifiant() == "yazid" && authentificationForm.getMotdepasse() == "yazid") { return mapping.findForward("succes"); } else { return mapping.findForward("erreurs"); } } }
es que quelqu'un pourrait m'aider car ça fait 2 jours que je suis dessus et je n'arrive toujours pas à savoir ou est l'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 package actionform; import org.apache.struts.action.ActionForm; @SuppressWarnings("serial") public class AuthentificationForm extends ActionForm { private String identifiant; private String motdepasse; public String getIdentifiant() { return identifiant; } public String getMotdepasse() { return motdepasse; } public void setIdentifiant(String identifiant) { this.identifiant = identifiant; } public void setMotdepasse(String motdepasse) { this.motdepasse = motdepasse; } }
Merci d'avance.
Partager