单项选择题


The tag handler for n:recurse extends SimpleTagSupport.Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?()  

A. It is impossible to determine the deepest nesting depth because it is impossible for tag handlers that extend SimpleTagSupport to communicate with their parent and child tags
B. Create a private non-static attribute in the tag handler class called count of type int initialized to      oIncrement count in the doTag method. If the tag has a body, invoke the fragment for that body. Otherwise, output the value of count
C. Start a counter at 1. Call getChildTags(). If it returns null, output the value of the counter.      Otherwise, increment counter and continue from where getChildTags() is called. Skip      processing of the body.
D. If the tag has a body, invoke the fragment for that body. Otherwise, start a counter at 1. Call      getParent(). If it returns null, output the value of the counter. Otherwise, increment the counter      and continue from where getParent() is called.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题


Which code snippet, inserted at line 8, causes the value Company to be output?()

A. JspWriter w = pageContext.getOut();w.print(“Company”);
B. JspWriter w = pageContext.getWriter();w.print(“Company”);
C. JspWriter w = new JspWriter(pageContext.getOut()); w.print(“Company”);
D. JspWriter w = new JspWriter (pageContext.getResponse()); w.print(“Company”);

2.单项选择题

Which statement, at line 16, retrieves an InputStream for the file /WEBINF/ nyresrc.bin()?

A. new InputStream(“/WEB-INF/nyressrc.bin”);
B. ctx.getInputStream(“/WEB-INF/nyresrc.bin”);
C. ctx.getresourceAsStream(“/WEB-INF/nyresrc.bin”);
D. new InputStream(“/WEB-INF/nyresrc.bin”);
E. getClass().getResourceAsStream(“/WEB-INF/nyresrc.bin”);

3.多项选择题


Which three can be placed at line 23 to retrieve an existing HttpSession object?()

A. HttpSession session = request.getSession();
B. HttpSession session = request.getSession(id);
C. HttpSession session = request.getSession(true);
D. HttpSession session = request.getSession(false);
E. HttpSession session = request.getSession(“jsessionid”)

4.单项选择题A developer for the Company.com web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?()  

A. The developer must ensure that every URL is properly encoded using the appropriate URL rewriting APIs
B. The developer must provide an alternate mechanism for managing sessions and abandon theHttpSession mechanism entirely
C. The developer can ignore this issue. Web containers are required to support automatic URL rewriting when cookies are not supported
D. The developer must ass the string ?id= to the end of every URL to ensure that the conversion with the browser can continue.

6.单项选择题


What code, inserted at line 21, is called prior to a session being migrated to a different JVM assuming the web application containing MyExample is deployed in a container which supports distributed applications?()

A. public void valueUnbound(HttpSessionEvent ev){...}
B. public void sessionPassivated(HttpSessionEvent ev){...}
C. public void sessionDidActivate(HttpSessionEvent ev){...}
D. public void sessionWillPassivate(HttpSessionEvent ev){...}

7.多项选择题Which the three are true about servlet filters?()

A. A filter must implement the destroy method
B. A filter must implement the doFilter method
C. A servlet may have multiple filters associated with it
D. A servlet that is to have a filter applied to it must implement the javax.servlet.FilterChain  interface
E. A filter that is part of a filter chain passes control to the next filter in the chain by invoking the filterChain forward method
F. For each  element in the web application deployment descriptor, multiple instances of a filter may be created by the web container

9.单项选择题

Given the HttpServlet code:  
getServletContext().setAttribute(“foo”, “value”);
What is the result?()

A. The attribute foo is placed in the application
B. A ServletContextListener registered for that servlet is notified
C. A ServletAttributeListener registered for that servlet is notified
D. An HttpSessionAttributeListener registered for that servlet is notified

10.单项选择题Which is the true choice about the web container request processing model()?

A. The init method on a filter is called the first time a servlet mapped to that filter is invoked
B. A filter defined for a servlet must always forward control to the next resource in the filter chain.
C. Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file
D. If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it

最新试题

Which code snippet, inserted at line 8, causes the value Company to be output?()

题型:单项选择题

A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of the com.Company.  Product class with a name property of “The Matrix” and price property of 39.95. Given the JSP page code snippet:What is the response output of this JSP page code snippet? ()

题型:单项选择题

Which path, relative to a web application’s root, identifies the web application’s deployment descriptor?()

题型:单项选择题

Which the three interfaces need to be declared in the web application deployment descriptor? ()

题型:多项选择题

Which two are true?()

题型:多项选择题

Which three are guaranteed to be valid for the  element of a web application deployment descriptor?()

题型:多项选择题

Which two are true()

题型:多项选择题

A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed. Which two are true? ()

题型:多项选择题

A developer for the Company.com web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?()  

题型:单项选择题

Which the three are true about servlet filters?()

题型:多项选择题