Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock question -- security

 
Tiffiny Yang
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following web page is defined as the custom form login page for authentication. Assuming that you have attempted to access a protected resource and been redirected to this web page, what is the result of filling in the user name and password fields and pressing SUBMIT? (Choose one.)
<html>
<head><title>Login Form</title></head>
<body>
<form action="jsecuritycheck" method="POST>
<br />Name: <input type="text" name="jusername" />
<br />Password: <input type="password" name="jpassword" />
<br /><input type="submit" value="Log In" />
</form>
</body>
</html>
A.You will not be redirected to this page in the first place.
B.HTTP 401 or 403 error (forbidden/not authorized).
C.HTTP 404 error (page not found).
D.HTTP 500 error (server error).
E.The page is redisplayed.

answer is E.

I think it should be C, and I tried it, it's HTTP 404 error (page not found). I am using TomCat 5.5.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would have guessed C as well, since an action of "jsecuritycheck" has no special meaning. In order to invoke the authentication check it should be "j_security_check".
 
Tiffiny Yang
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic