Please note out errors in Eduardo Cobian's SCWCD Test (at java ranch) with authentic references.And if u find some mistake has been made by me, please comment out with authentic references.
Q4 since scriptlets code go to _jspService methods so ur code is equivalent to override or redifine the method inside a method and their is no concept of nested methods in java so code is that is why illegal Q8 correct ans is(1,3).Ref: Java Server Programming J2EE edition vol 1 page no.543 Q.18 correct ans is(1,2,3)where as ur ans is(1,3).Ref:java server prog. j2ee ed. vol 1 page 538
Q23 Ur ans is right but explanation is not complete.Run time expressions are also allowed in useBean attr. beanName
Q24 mistake no 1:doAfterBody() is not defined in TagSupport class but in its sub class BodyTagSupport so it has not been overriden in this class an wont be called by jsp container Refer:API documentation mistake:2 By default doStartTag() returns EVALUATE_BODY_INCLUDE in TagSupport class and EVALUATE_BODY_TAG in BodyTagSupport class(incorrect explanation).Refer:same j2ee book page 543 ,1st paragraph mistake3:correct ans is option 1 and "Hello"will be printed Note: if this class would extend BodyTagSupport then all given options would be wrong and "how r u"would have been printed because the body content "hello" would have been written to BodyContent instance but not to its enclosing JspWriter instance.
Q25 answer is right but explanation is wrong.Actually tag's body contents are directly written to writer object of jsp when tag has its handler implementing TagSupport and doStartTag() method has its default implementation there. Q26 all options are incorrect and just "how r u "will be printed. explanation:actually body contents of tag whose handler is an implementation of BodyTagSupport are directly written to BodyContent object(unless doStartTag() returns "EVELUATE_BODY_TAG" WHICH IS ITS DEFAULT IMPLEMENTATION) and not to Jsp writer so hello will not be output here Q42 option 1 and 2 r right choice Q44: explanation is not complete .There is no doHead method defined in HttpServlet(see API) Q47 ServletRequest has not setCharacterEncoding method(see API) Q48 resetBuffer() is not declared any where and reset() has been in ServletResponse(see API) Q59 pageEncoding is not an attr. of page directive [This message has been edited by Fozan Zaidi (edited December 06, 2001).]
Fozon Zaidi, Yup !!! You are right in some cases and in some cases Eduardo Cobian is right !!! Here are the answers for some of your views after thorough verification: 4) With regd to Question # 4 of Eduardo Cobian's test, You are right !!! 24) With regd to Question # 24 of Eduardo Cobian's test, You are right !!! 47) With regd to Question # 47 of Eduardo Cobian's test, Eduardo Cobian is right!!! Please see the api at http://java.sun.com/products/servlet/2.3/javadoc/index.html See servlet 2.3 spec API!!! 48) With regd to Question # 48 of Eduardo Cobian's test, Eduardo Cobian is right !!! Please see the api at http://java.sun.com/products/servlet/2.3/javadoc/index.html See servlet 2.3 spec API!!! 59) With regd to Question # 59 of Eduardo Cobian's test, Eduardo Cobian is right !!! See JSP 1.2 specification
Questions, let me know !!! ...
Regards, Krishna Varma Adluru
posted 18 years ago
Thanks Kirishna Actually I used servlet api 2.2 and jsp specification 1.1 Can some body tell me where is "latest" api for package javax.servlet.jsp.tagest found