request.getParameter("j_username") gets null?

Hello,

I am using j_security_check feature to make login page.

my Login page is :

<html>

<head>

<title>Login Page</title>

</head>

<body bgcolor="white">

<h2> <center> Custom Login Page </center></h2>

<hr width='90%' align='center'>

<form method="POST" action="j_security_check">

<table border="0" cellspacing="5" align='center'>

<tr>

<th align="right">Username:</th>

<td align="left"><input type="text" name="j_username"></td>

</tr>

<tr>

<th align="right">Password:</th>

<td align="left"><input type="password" name="j_password"></td>

</tr>

<tr>

<td align="right"><input type="submit" value="Login"></td>

<td align="left"><input type="reset"></td>

</tr>

</table>

</form>

</body>

</html>

myprotected page is: myhome.jsp

<%@ page language="java" %>

<!DOCTYPE HTML PUBLIC"-//w3c//dtd html 4.0 transitional//en">

<html>

<head>

<title>Marco-Molecular Docking Program </title>

</head>

<body bgcolor="#FFFFFF">

<%!int colspan = 2; %>

Welcome : <% request.getParameter("j_password"); %>

</BODY>

</HTML>

I have configured and can log in login.jsp page, but the myhome.jsp display the password is null. Does anybody can help me ?

Thanks a lot.

[2431 byte] By [senthil_yogaa] at [2007-11-27 10:02:23]
# 1
Use HttpServletRequest#getUserPrincipal() to retrieve them.Why do you want to show the password as welcome text anyway? Bad practice.
BalusCa at 2007-7-13 0:36:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank u for ur quick reply...how can i retrieve the password....>>Why do you want to show the password as welcome text anyway? Bad practice.then what's the other waythank u a lot once again
senthil_yogaa at 2007-7-13 0:36:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

> Thank u for ur quick reply...

>

> how can i retrieve the password....

Not.

> then what's the other way

"Welcome Senthil_yoga" reads more pleased than "Welcome d$7hF_r!9Y", don't you?

And showing passwords in public may cause bad user experience.

BalusCa at 2007-7-13 0:36:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Reply to BaluC Thank u a lot for ur suggestions...then how can i create session for password while using j_security_checksorry , i have to change to j_username, not password in the welcome
senthil_yogaa at 2007-7-13 0:36:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

> how can i create session for password

What do you mean exactly? The session is just available as HttpSession obejct available through HttpServletRequest#getSession().

Or do you want unique identifiers? Rather use the username. Passwords should never be considered as unique. 2 different users *can* have the same password. You don't need to know about passwords at all anyway.

BalusCa at 2007-7-13 0:36:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...