Bonjour,
j'ai cherché partout sur les forums avant de me decider à vous ennuyer:
voila mon problème, avec mon code:
un fichier jsp que j'ai mis dans webapps/ROOT :
nom du fichier: FirstPage.jsp
<%@ page import="blabla.IdentificationBean" %>
<jsp:useBean id=" logPass" scope="session" class="blabla.IdentificationBean" >
<jsp:setProperty name="logPass" property="*" />
</jsp:useBean>
<html>
<head>
<title>Auction WebSite</title>
</head>
<body>
<h1 align="center">Auction Website</h1>
<form action="
http://localhost:8080/MakeBid.jsp"
method="post">
Salut, <%= logPass.getLogin() %>
this is the item of the day : <br>
the name: a beautiful lamp<br>
the doner: boby<br>
how the money will be used: for the children<br>
the actual higher bid for the item: 2000$<br>
<input type="submit" value="Make a bid">
</form>
</body>
</html>
et une classe que j'ai mis dans le dossier WEB-INF/classes/blabla:
qui s'appelle IdentificationBean.java:
package blabla;
public class IdentificationBean {
public String login,password;
public IdentificationBean(){
String login="inconnu", password="stupide";
}
public void setLogin(String h) { login = h;}
public void setPassword(String w) { password = w;}
public String getLogin () { return login;}
public String getPassword() { return password;}
}
et j'ai une erreur :
org.apache.jasper.JasperException: An exception occurred processing JSP page /FirstPage.jsp at line 4
1:
2: <%@ page import="blabla.IdentificationBean" %>
3: <jsp:useBean id=" logPass" scope="page" class="blabla.IdentificationBean" >
4: <jsp:setProperty name="logPass" property="*" />
5: </jsp:useBean>
6:
7:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
cause mère
org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:361)
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:308)
org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:286)
org.apache.jsp.FirstPage_jsp._jspService(FirstPage_jsp.java:64)
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:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
je ne comprend pas pourquoi ça ne marche pas!!
merci beaucoup de votre aide.
rooloulou
Configuration: Windows Vista
Internet Explorer 7.0