Account account = request.get Resource(”account”):
Account account = request.get Attribute (“account”):
Account account = request.get Parameter (account”):
Account account = (Account)request.getResource (“account”):
Account account = (Account) request.get Attribute (“account”):
Account account = (Account) request.get Paramter (“account”):
第1题:
Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()
第2题:
Given a header in an HTTP request:X-Retries:4 Which two retrieve the value of the header from a given HttpServletRequest request?()
第3题:
Servlet的基本架构
public class ServletName extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
}
}
1、用String的方法将数据类型转换为String。
1、String.valueOf(1.23)
第4题:
Given an HttpServletRequest request and HttpServletResponse response,which sets a cookie "username"with the value "joe" in a servlet?()
第5题:
Given an HttpServletRequest request, which retrieves an object of type Account with an Id of “account”?()
第6题:
Given an HttpServletRequest request: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()
第7题:
下面关于HttpServletRequest接口描述错误的是()
第8题:
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 here 26.} 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?()
第9题:
Given a web application in which the request parameter product ID contains a product identifier.Which two EL expressions evaluate the value of the product ID?()
第10题:
Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()