SCWCD-17 05/13/2008
 

Your servlet class depends on a utility class named com.abc.TaxUtil. Where would you keep the TaxUtil.class file? (Select one)

a WEB-INF

b WEB-INF/classes

c WEB-INF/lib

d WEB-INF/jars

e WEB-INF/classes/com/abc

Answer: e

   
Which method is used to retrieve an initialization parameter from a Servlet- Context? (Select one)

a Object getInitParameter(int index)

b Object getParameter(int index)

c Object getInitParameter(String name)

d String getInitParameter(String name)

e String getParameter(String name)

Answer: d

 

Which of the following methods will expunge a session object? (Select one)

a session.invalidate();

b session.expunge();

c session.destroy();

d session.end();

e session.close();

Answer: a

 

Identify the authentication mechanisms that are built into the HTTP specification. (Select two)

a Basic

b Client-Cert

c FORM

d Digest

e Client-Digest

f HTTPS

Answers: a and d

 
Write the name of the method that you can use to initialize variables declared in a JSP declaration in the space provided. (Write only the name of the method. Do

not write the return type, parameters, or parentheses.)

a [_____________]

Answer: jspInit
 


The implicit variable config in a JSP page refers to an object of type: (Select one)

a javax.servlet.PageConfig

b javax.servlet.jsp.PageConfig

c javax.servlet.ServletConfig

d javax.servlet.ServletContext

Answer: c

 
 
Consider the contents of two JSP files: File 1: test1.jsp <html><body> <% pageContext.setAttribute("ninetyNine", new Integer(99)); %> //1 </body></html> File 2: test2.jsp The number is <%= pageContext.getAttribute("ninetyNine") %> Which of the following, when placed at line //1 in the test1.jsp file, will allow the test2.jsp file to print the value of the attribute when test1.jsp is requested? (Select one)

a <jsp:include page="test2.jsp" />

b <jsp:forward page="test2.jsp" />

c <%@ include file="test2.jsp" %>

d None of the above because objects placed in pageContext have the page scope

and cannot be shared with other components.

Answer: c

 


Comments




Leave a Reply

    SCWCD Sets


    Archives

    May 2008
    April 2008