id
name
bean
type
scope
第1题:
You have built your own light-weight templating mechanism. Your servlets, which handle each request,dispatch the request to one of a small set of template JSP pages. Each template JSP controls the layout ofthe view by inserting the header, body, and footer elements into specific locations within the template page.The URLs for these three elements are stored in request scoped variables called, headerURL, bodyURL,and footerURL, respectively. These attribute names are never used for other purposes. Which JSP codesnippet should be used in the template JSP to insert the JSP content for the body of the page?()
第2题:
Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()
第3题:
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?()
第4题:
A custom tag is defined to take three attributes. Which two correctly invoke the tag within a JSP page?()
第5题:
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?()
第6题:
<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>
第7题:
id
name
bean
type
scope
第8题:
<jsp:useBean id=’pageBean’ type=’com.example.MyBean’ />
<jsp:useBean id=’pageBean’ class=’com.example.MyBean’ />
<jsp:makeBean id=’pageBean’ type=’com.example.MyBean’ />
<jsp:makeBean id=’pageBean’ class=’com.example.MyBean’ />
第9题:
Id
Val
Name
Param
Value
Property
第10题:
id
type
name
class
scope
create
第11题:
HttpSession
ServletConfig
ServletContext
HttpServletRequest
HttpServletResponse
第12题:
<prefix:myTag a=foo b=bar c=baz />
<prefix:myTag attributes={foo,bar,baz} />
<prefix:myTag jsp:attribute a=foo b=bar c=baz />
<prefix:myTag><jsp:attribute name=a>foo</jsp:attribute><jsp:attribute name=b>bar</jsp:attribute><jsp:attribute name=c>baz</jsp:attribute>. </prefix:myTag>
第13题:
You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the
第14题:
第15题:
A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()
第16题:
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 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?()
第17题:
Servlet A receives a request that it forwards to servlet B within another web application in the same web container. Servlet A needs to share data with servlet B and that data must not be visible to other servlets in A’s web application. In which object can the data that A shares with B be stored?()
第18题:
Tag files can only be accessed using a tagdir attribute.
The sort.jsp page translates successfully and invokes the tag defined by beta.tag.
The sort.jsp page produces a translation error because a taglib directive must always have a uriattribute.
Tag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB- INF/tags.
The tagdir attribute in line 2 can be replaced by a uri attribute if a TLD referring to beta.tag is createdand added to the web application.
第19题:
Default costs 0.0
Default costs 49.95
Default costs 39.95
The Matrix costs 0.0
The Matrix costs 49.95
The Matrix costs 39.95
第20题:
<jsp:insert page=’${bodyURL}’ />
<jsp:insert file=’${bodyURL}’ />
<jsp:include page=’${bodyURL}’ />
<jsp:include file=’${bodyURL}’ />
<jsp:insert page=’<%= bodyURL %>’ />
第21题:
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.
第22题:
Id
Type
Name
Class
Yscope
第23题:
Id
Val
Name
Param
Value
Property
第24题:
javax.servlet.http.HttpSessionListener
javax.servlet.http.HttpSessionBindingListener
javax.servlet.http.HttpSessionAttributeListener
javax.servlet.http.HttpSessionActivationListener