• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock test question

 
trupti nigam
Ranch Hand
Posts: 626
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question ID :996515982693
Which of the following XML frgaments correctly define the <login-config> element of web.xml?
1.
<login-config>
<auth-method>CLIENT-CERT</auth-method>
<realm-name>test</realm-name>
</login-config>
2.
<login-config>
<auth-method>CLIENT-CERT</auth-method>
<realm-name>test</realm-name>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page>
<form-error-page>/jsp/error.jsp</form-error-page>
</form-login-config>
</login-config>

3.
<login-config>
<auth-method>FORM</auth-method>
<realm-name>test</realm-name>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page>
<form-error-page>/jsp/error.jsp</form-error-page>
</form-login-config>
</login-config>
4.
<login-config>
<auth-method>FORM</auth-method>
<realm-name>test</realm-name>
</login-config>
5.
<login-config>
<auth-method>SECURE</auth-method>
<realm-name>test</realm-name>
</login-config>
Correct answers given are 1,2,3 but realm name is used only in case of BASIC authorization,so in that case how come 1 and 2 can be correct answers??
thanks,
Trupti
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m puzzled. Sorry, for my lack of knowledge. How can FORM (case 3) be a BASIC type also?
 
See El
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1,2,3 follows the DTD for login-config :
<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
so it's perfectly fine.
In 3, realm-name is not needed though, so it's just being ignored.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic