A JSP page contains a taglib directive whose uri attribute has the value dbtags.
Which XML element withinthe web application deployment descriptor defines the associated TLD?()
A.<tld><uri>dbtags</uri><location>/WEB-INF/tlds/dbtags.tld</location></tld>
B.<taglib><uri>dbtags</uri><location>/WEB-INF/tlds/dbtags.tld</location>. </taglib>
C.<tld>. <tld-uri>dbtags</tld-uri>. <tld-location>/WEB-INF/tlds/dbtags.tld</tld-location> . </tld>
D.<taglib><taglib-uri>dbtags</taglib-uri><taglib-location>/WEB-INF/tlds/dbtags.tld. </taglib-location>. </taglib>
您可能感興趣的試卷
你可能感興趣的試題
Assume the custom tag my:errorProne always throws a java.lang.RuntimeException with the message "Filenot found." An error page has been configured for this JSP page.
Which option prevents the exceptionthrown by my:errorProne from invoking the error page mechanism, and outputs the message "File notfound" in the response?()
A.<c:try catch="ex"><my:errorProne /></c:try>${ex.message}
B.<c:catch var="ex"><my:errorProne /></c:catch>${ex.message}
C.<c:try>. <my:errorProne />. </c:try>. <c:catch var="ex" />. ${ex.message}
D.<c:try>. <my:errorProne />. <c:catch var="ex" />. ${ex.message}. </c:try>
You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object.
Which two JSP code snippets can you use to import these list types?()
A.<%! import java.util.*; %>
B.<%! import java.util.List;import java.util.ArrayList; %>
C.<%@ page import=’java.util.List’import=’java.util.ArrayList’ %>
D.<%@ import types=’java.util.List’types=’java.util.ArrayList’ %>
E.<%@ page import=’java.util.List,java.util.ArrayList’ %>
F.<%@ import types=’java.util.List,java.util.ArrayList’ %>
You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once.
Which three are possible mechanisms for performing this initialization code?()
A.In the init method.
B.In the jspInit method.
C.In the constructor of the JSP’s Java code.
D.In a JSP declaration, which includes an initializer block.
E.In a JSP declaration, which includes a static initializer block.
Given the element from the web application deployment descriptor:
<jsp-property-group>
<url-pattern>/main/page1.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
and given that /main/page1.jsp contains:
<% int i = 12; %>
<b><%= i %></b>
What is the result?()
A.<b></b>
B.<b>12</b>
C.The JSP fails to execute.
D.<% int i = 12 %><b><%= i %></b>
In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored asa List object in the catalog attribute of the webapp’s ServletContext object.
Which scriptlet code snippetgives you access to the catalog object?()
A.<% List catalog = config.getAttribute("catalog"); %>
B.<% List catalog = context.getAttribute("catalog"); %>
C.<% List catalog = application.getAttribute("catalog"); %>
D.<% List catalog = servletContext.getAttribute("catalog"); %>
最新試題
Given a Filter class definition with this method:21.public void doFilter(ServletRequest request,22.ServletResponse response,23.FilterChain chain)24.throws ServletException, IOException {25.// insert code here26.}Which should you insert at line 25 to properly invoke the next filter in the chain, or the target servlet if thereare no more filters?()
You are building a web application with a scheduling component. On the JSP, you need to show the currentdate, the date of the previous week, and the date of the next week. To help you present this information,you have created the following EL functions in the ’d’ namespace: name: curDate; signature: java.util.DatecurrentDate() name: addWeek; signature: java.util.Date addWeek(java.util.Date, int) name: dateString;signature:java.util.String getDateString(java.util.Date)Which EL code snippet will generate the string for the previousweek?
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()
Your company has a corporate policy that prohibits storing a customer’s credit card number in anycorporate database. However, users have complained that they do NOT want to re- enter their credit cardnumber for each transaction. Your management has decided to use client-side cookies to record the user’scredit card number for 120 days. Furthermore, they also want to protect this information during transit fromthe web browser to the web container; so the cookie must only be transmitted over HTTPS.Which codesnippet creates the "creditCard" cookie and adds it to the out going response to be stored on the user’s webbrowser?()
You are building a dating web site. The client’s date of birth is collected along with lots of other information.The Person class has a derived method, getAge():int, which returns the person’s age calculated from thedate of birth and today’s date. In one of your JSPs you need to print a special message to clients within theage group of 25 through 35.Which two EL code snippets will return true for this condition? ()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the 'Select and Place' button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:public interface ApplicationController {public String invoke(HttpServletRequest request)}The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext.Which code snippet of the FrontController servlet accomplishes this goal?()
A web browser need NOT always perform a complete request for a particular page that it suspects mightNOT have changed. The HTTP specification provides a mechanism for the browser to retrieve only a partialresponse from the web server; this response includes information, such as the Last-Modified date but NOTthe body of the page.Which HTTP method will the browser use to retrieve such a partial response?()