A JSP page needs to instantiate a JavaBean to be used by only that page.
Which two jsp:useBeanattributes must be used to access this attribute in the JSP page?()
A.Id
B.Type
C.Name
D.Class
E.Yscope
您可能感興趣的試卷
你可能感興趣的試題
Your web application views all have the same header, which includes the <title> tag in the <head> elementof the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put itinto a single JSP called /WEB-INF/jsp/header.jsp. However, the title of each page is unique, so you havedecided to use a variable called pageTitle to parameterize this in the header JSP, like this:
10.<title>${param.pageTitle}<title>
Which JSP code snippet should you use in your main view JSPs to insert the header and pass thepageTitle variable?()
A.<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:insert>
B.<jsp:include page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>
C.<jsp:include file=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>
D.<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:insert>
E.<jsp:include page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:include>
A JSP page needs to set the property of a given JavaBean to a value that is calculated with the JSP page.
Which three jsp:setProperty attributes must be used to perform this initialization?()
A.Id
B.Val
C.Name
D.Param
E.Value
F.Property
Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp.
How can you accomplish this goal?()
A.Store the data in a public instance variable in the servlet.
B.Add an attribute to the request object before using the request dispatcher.
C.Add an attribute to the context object before using the request dispatcher.
D.This CANNOT be done as the tag handler has no means to extract this data.
Given the web application deployment descriptor elements:
11.<filter>
12.<filter-name>ParamAdder</filter-name>
13.<filter-class>com.example.ParamAdder</filter-class>
14.</filter>...
24.<filter-mapping>
25.<filter-name>ParamAdder</filter-name>
26.<servlet-name>MyServlet</servlet-name>
27.<!-- insert element here -->
28.</filter-mapping>
Which element, inserted at line 27,causes the ParamAdder filter to be applied when MyServlet is invokedby another servlet using the RequestDispatcher.include method?()
A.<include/>
B.<dispatcher>INCLUDE</dispatcher>
C.<dispatcher>include</dispatcher>
D.<filter-condition>INCLUDE</filter-condition>
E.<filter-condition>include</filter-condition>
最新試題
You are building a dating service web site. Part of the form to submit a client’s profile is a groupIIof radio buttons for the person’s hobbies:20.<input type=’radio’ name=’hobbyEnum’ value=’HIKING’>Hiking <br>21.<input type=’radio’ name=’hobbyEnum’ value=’SKIING’>Skiing <br>22.<input type=’radio’ name=’hobbyEnum’ value=’SCUBA’>SCUBA Diving23.<!-- and more options -->After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume thatan application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the displayname.Which EL code snippet will display Nth element of the user’s selected hobbies?()
You need to create a JSP that generates some JavaScript code to populate an array of strings used on the client-side.Which JSP code snippet will create this array?()
A web application allows the HTML title banner to be set using a servlet context initialization parametercalled titleStr.Which two properly set the title in this scenario?()
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?
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.
Which two are valid and equivalent?()
Which three are true about servlet filters?()
The JSP developer wants a comment to be visible in the final output to the browser.Which comment styleneeds to be used in a JSP page?()