• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

conditional login.jsp

 
Pavel Saratchev
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

is it possible to make a condition for the jogin.jsp. If there are name='...' and password='...' in the query string from the Request and the both of them are not empty, than I want to run the j_securitycheck action automatically and not have to write the name and the password in the form. My login.jsp looks at the moment like this:

<html>
<head>
</head>

<body>
<form method="POST" action="j_security_check">
<table>
<!-- input fields -->
<tr>
<td align="left">User Name:</td>
<td align="right"><input tabindex="1" type="text" name="j_username"></td>
</tr>
<tr>
<td align="left">Password:</td>
<td align="right"><input tabindex="2" type="password" name="j_password"></td>
</tr>

<!-- Save/Reset buttons -->
<tr>
<td colspan="2">
<input type="submit" name="save" value="Log in" />

<input type="reset" name="reset" value="Reset" />
</td>
</tr>
</table>
</form>
</body>

</html>
 
Chakravarthy Gogineni
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write a javascript function to check for those fields before submitting the form. Which returns true if both the fields are not empty. You can call this function after Onclick event.



When Javascript function returns true, then only request is forwarded to the action.

onKlick, 'K' should be replaced with 'c. Had to write like that as this replying system is not letting to post and complaining about javascipt malicious content
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really want to put someone's password in the querystring?
 
Chakravarthy Gogineni
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please explain what does it mean by putting password in query string?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic