• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubts on mock exams

 
jyothi sanka
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1:If you give -ve value to this element <load-on-startup> what is the result?

2:<body-content>tagdependent</body-content> answer in the mock exam is it must implement the BodyTag interface. is it correct? can't we use in TagSupport classes ?


3:HFS mock exam Q-11
${map[map-index]
if you don't give quotes in the[]operator container looks for that name of attribute. so here there is map-index attribute. why can't container can't get this value?

4 what is the default value of the attribute's rtexprvalue in tagFiles?

5 what is the resylt in 2 conditions:
<session-timeout>0</session-timeout>
<session-timeout>-2</session-timeout>

6: what is the difference between encodeURL() and encodeRedirectURL()

thanks
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1:If you give -ve value to this element <load-on-startup> what is the result?

Ans 1: I guess -ve value will be ignored and will be same as not specifying any load-on-startup element.


2:<body-content>tagdependent</body-content> answer in the mock exam is it must implement the BodyTag interface. is it correct? can't we use in TagSupport classes ?

Ans 2: NO because by specifying tagdependent we mean that tag handler class will deal with the body so it will not evaluate the body and you get the control of the bodycontents only when u implement BodyTag interface.

3:HFS mock exam Q-11
${map[map-index]
if you don't give quotes in the[]operator container looks for that name of attribute. so here there is map-index attribute. why can't container can't get this value?

Ans 3: No because it will search for attribute map then it will get the value for index and then it will try to subtract the value of index from map and then that result is passed to ${map[result of subtraction ] }.
So it doesnt work..


4 what is the default value of the attribute's rtexprvalue in tagFiles?
Ans 4: false or no
Possible values true, false,yes, no

5 what is the resylt in 2 conditions:
<session-timeout>0</session-timeout>
<session-timeout>-2</session-timeout>

Ans 5: session-timeout of 0 or negative no indicates that session will never expire.

6: what is the difference between encodeURL() and encodeRedirectURL()

Ans 6:encodeURL will encode the url and encodeRedirectURL() also encodes the url but the later is used in response.sendRedirect() method. The first one can be used in href tag in html that will get generated by the servlet.

Regards
Rohit
SCJP1.4,SCWCD1.4
[ March 12, 2005: Message edited by: Rohit Bhagwat ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic