Friday, June 1, 2007

Sun Certified Web Component Developer 310-081 Sample Questions

1. Which of the following methods is used to extract a session ID from a manually rewritten URL?

A. getParameter(String name)

B. getSessionID()

C. getPathInfo()

D. getID()


2. Which of the following is a legal exception-type description?

A. javax.servlet.ServletException

B. ServletException

C. javax.servlet.http.UnavailableException

D. UnavailableException


3. Which of the following options best defines the full signature name for the servlet method associated with a POST request? (Choose all that apply.)

A. protected void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException

B. public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException

C. public void doPost(ServletRequest req, ServletResponse res) throws IOException, ServletException

D. private void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException


4. Which of the following statements is true?

A. The listener tag is used to define all context and session listeners.

B. The listener interface name must be defined within the deployment descriptor.

C. The HttpSessionActivationListener must be defined within the originating server only.


5. When using FORM authentication, your form writes to which of the following URLs?

A. /servlet

B. j_security

C. j_security_source

D. j_security_check


6. A taglib directive must define which of the following attributes?

A. value

B. prefix

C. uri

D. uri and location

E. uri and prefix


7. Which of the following commands would best create a WAR file for a web application whose context is defined as /webapps/stocks?

A. jar -tvf stockApp.war /webapps/stocks

B. jar -cvf stockApp.war /webapps/stocks

C. war -cvf stockApp.war /webapps/stocks

D. jar -cvf stockApp.war /webapps/

E. Both war -cvf stockApp.war /webapps/stocks and jar -cvf stockApp.war /webapps/


8. Consider the following HTML page code:

<html><body>

<a href="/servlet/HelloServlet">POST</a>

</body></html>

Which method of HelloServlet will be invoked when the hyperlink displayed by the above page is clicked? (Select one)

a doGet

b doPost

c doForm

d doHref

e serviceGet


9. What is the term for determining whether a user has access to a particular resource? (Select one)

a Authorization

b Authentication

c Confidentiality

d Secrecy


10. Which of the following variables is not available for use in EL expressions?

a param

b cookie

c header

d pageContext

e contextScope



=>





  1. J2EE Patterns

  2. SCJP 310-035 Sample Questions (1)

  3. Answers of "SCJP 310-035 Sample Questions (1)"

  4. Catalog of design patterns


=>

Latest Posts