Attend this J1z0-858 Java Enterprise Edition Component Developer Exam will get a Good Score 80% on Main Exam

Description

Sample Questions:

You are creating a servlet that generates stock market graphs. You want to provide the web browser with precise information about the amount of data being sent in the response stream. Which two HttpServletResponse methods will you use to provide this information? (Choose two.)

response.setLength(numberOfBytes);

response.setContentLength(numberOfBytes);

response.setHeader(“Length”, numberOfBytes);

response.setIntHeader(“Length”, numberOfBytes);

response.setHeader(“Content-Length”, numberOfBytes);

response.setIntHeader(“Content-Length”, numberOfBytes);

Which two prevent a servlet from handling requests? (Choose two.)

The servlet’s init method returns a non-zero status.

The servlet’s init method throws a ServletException.

The servlet’s init method sets the ServletResponse’s content length to 0.

The servlet’s init method sets the ServletResponse’s content type to null.

The servlet’s init method does NOT return within a time period defined by the servlet container.

Which retrieves all cookies sent in a given HttpServletRequest request?

request.getCookies()

request.getAttributes()

request.getSession().getCookies()

request.getSession().getAttributes()

Which three are true about servlet filters? (Choose three.)

A filter must implement the destroy method.

A filter must implement the doFilter method.

A servlet may have multiple filters associated with it.

A servlet that is to have a filter applied to it must implement the javax.servlet.FilterChain interface.

A filter that is part of a filter chain passes control to the next filter in the chain by invoking the FilterChain.forward method.

For each <filter> element in the web application deployment descriptor, multiple instances of a filter may be created by the web container.

Which is true about the web container request processing model?

The init method on a filter is called the first time a servlet mapped to that filter is invoked.

A filter defined for a servlet must always forward control to the next resource in the filter chain.

Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file.

If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it.

Your web application uses a simple architecture in which servlets handle requests and then forward to a JSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation. This information must NOT be accessible to any other servlet, JSP or session in the webapp. Which two techniques can you use to accomplish this goal? (Choose two.)

Add attributes to the session object.

Add attributes on the request object.

Add parameters to the request object.

Use the pageContext object to add request attributes.

Add parameters to the JSP’s URL when generating the request dispatcher.

Who this course is for:

  • Those who want to get knowledge on Certifications & Check your Skill Test while attend this Practice Test