Probleme avec ma jsp

Nina2507 Messages postés 32 Date d'inscription mercredi 1 novembre 2006 Statut Membre Dernière intervention 24 avril 2008 - 23 mai 2007 à 01:54
super_toinou Messages postés 764 Date d'inscription mardi 25 mai 2004 Statut Membre Dernière intervention 8 mars 2011 - 23 mai 2007 à 09:58
bsr tout le monde,
je travail avec tomcat et myEclipse, j'essai de lancé une jsp mais j'y arrive pas il me donne une exception:"NullPointerException"
je crois que c'est parce qu'il trouve les champs du formulaire encore vide;mais j'ai tout fais pour qu'il les vérifie avant d'appeler la methode qui les utilise
voici une partie de ma jsp
j'espère ke vous me dite il est ou le problème:

<form action=
"client/client.jsp" name=
"frmauth" method=
"post">

<input type=
"hidden" name=
"statu" value=
"nonConnecter">

<table width=
"400" border=
"1">

<%String login=request.getParameter(

"login");String pass=request.getParameter(

"pass");

if ((login ==
"")&&(pass==
"")){

%>

<tr><td>

<table width=
"400" border=
"0">

<tr><td colspan=
"2" align=
"center"><U><I>Veuillez vous authentifiez
</I></U></td></tr>

<tr>

<td width=
"200" align=
"right">Login
</td>

<td align=
"left"><input type=
"text" style=
"color:blue" size=
"30" maxsize=
"30" name=
"login" ></td>

</tr>

<tr>

<td width=
"200" align=
"right">Password
</td>

<td align=
"left"><input type=
"password" style=
"color:blue" size=
"30" maxsize=
"30" name=
"pass" ></td>

</tr>

</table>

</td>

</tr>

<tr>

<td align=
"center" colspan=
"2"><input type=
"submit" onclick=
"javascript:verifier()" value=
"envoyer" name=
"submit" style=
"width:100px;height:30px;color:blue;text-align:center;font-weight:bold;background-color:white;font-family:verdana">

<input type=
"button" name=
"reset" style=
"width:100px;height:30px;color:blue;text-align:center;font-weight:bold;background-color:white;font-family:verdana" value=
"Réinitialiser" onclick=
"javascript:effacer()">

<br><A href=
"client/inscriptionClient">S'inscrire
</A></td>

</tr>

<%}

else {

if(client.identifierClient(login,pass)){out.write(

"Bienvenue :"+ client.Nom+
" " + client.Prenom);}

else{response.encodeRedirectUrl(

"http://localhost:8080/locationAppart/client/authClient");out.write(

"<tr><td style ="color:red"></td></tr>");}

}

%>

</table>

</form>

je compte sur vous pour pouvoir avancé, je suis encore débutante..

1 réponse

super_toinou Messages postés 764 Date d'inscription mardi 25 mai 2004 Statut Membre Dernière intervention 8 mars 2011 6
23 mai 2007 à 09:58
Yopla,

a mon avis client est null -> Nullpointer dans client.identifierClient(login,pass). D ailleurs j vois meme pas ou tu l as défini dans ta page !

++ Toinou
0
Rejoignez-nous