request.addCookie(username, joe)
request.setCookie(username, joe)
response.addCookie(username, joe)
request.addHeader(new Cookie(username, joe))
request.addCookie(new Cookie(username, joe))
response.addCookie(new Cookie(username, joe))
第1题:
A.request.getWriter();
B.request.getReader();
C.request.getInputStream();
D.request.getResourceAsStream();
第2题:
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)
第3题:
A、HttpServletResponse接口的rewriteURL()方法
B、HttpServlet接口的rewriteURL()方法
C、HttpServletRequest接口的encodeURL()方法
D、HttpServletResponse接口的encodeURL()方法
第4题:
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?()
第5题:
下面哪个方法不是HttpServlet类:()
第6题:
A.HttpServletRequest、getSession
B.HttpServletResponse、newSession
C.HtttpSession、newInstance
D.HttpSession、getSession
第7题:
Servlet可以通过以下哪个接口实现请求转发机制?()
第8题:
给定某servlet 程序的片段,如下:
Public void doGet(HttpServletRequest
request,Httpservletresponse response)
{
_________
}
要把session的失效时间设为30分钟,应该在下划线处插入( )
A、request.getSession().setTimeout(1800);
B、request.getSession().setTimeout(30)
C、request.getSession().setMaxInactiveInterval(1800);
D、request.getSession().setMaxInactiveInterval(30);
第9题:
Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()
第10题:
Given a header in an HTTP request:X-Retries:4 Which two retrieve the value of the header from a given HttpServletRequest request?()