Tag: technology

Questions Related to technology

  1. 1)It won't compile

  2. 2)It will print the session id.

  3. 3)It will produce a NullPointerException as the getSession(false) method's call returns null, cause no session had been created.

  4. 4)It will produce an empty page.


Correct Option: B
  1. 1) There is no such method.

  2. 2) It searches the attribute in all 4 scopes.

  3. 3) It searches the attribute in page scope.

  4. 4) The method is findAttribute(String name, int scope)


Correct Option: B
  1. 1) web-resource-name

  2. 2) url-pattern

  3. 3) http-method

  4. 4) auth-constraint


Correct Option: A,B

What are the types returned by the ServletContext method getResource and getResourceAsStream?

  1. 1) ServletContext doesn't have one of these two methods.

  2. 2) String and InputStream

  3. 3) URL and InputStream

  4. 4) URL and StreamReader


Correct Option: C
  1. 1) getHeaderNames returns an Enumeration

  2. 2) getHeaders returns a String[]

  3. 3) getHeaderValues returns a String[]

  4. 4) getIntParameter returns an int


Correct Option: A
  1. 1) There is no such method.

  2. 2) It has two paramters: request and response

  3. 3) It has one parameter of type String which is the relative URL of the page to include.

  4. 4) This method is appropiate to use within a Tag class.


Correct Option: C,D
  1. 1) pushBody is called by the jsp container after doStartTag and before doAfterBdy

  2. 2) pushBody is called by the jsp container before doInitBody

  3. 3) popBody is called by the jsp container after doAfterBody and before doEndTag

  4. 4) popBody is called by the jsp container after doEndTag


Correct Option: A,C

. Is it true that all tags have a parent tag,which is null for top-level tags, and is the innermost containing tag for nested tags.

  1. 1) yes

  2. 2) no

  3. 3) only the second part of the statement is true.

  4. 3) only the first part of the statement is true.


Correct Option: A
  1. 1) By calling the method with an absolute path as the argument

  2. 2) By enconding the path with HttpServletResponse.endcodeURL method

  3. 3) By enconding the path with HttpServletResponse.endcodeRedirectURL method

  4. 4) If you use sendRedirect the session is lost.


Correct Option: C
  1. 1) It only contains the element role-name (besides element description)

  2. 2) Only the role-name specified in security-role-ref can be used

  3. 3) It is a subelement of web-resource-collection

  4. 4) It is related to authentication


Correct Option: A