有一自定义标签,代码如下
public class MyTag extends BodyTagSupport {
int i=0;
public int doAfterBody() {
while(i<3) {
i++;
return EVAL_BODY_AGAIN; }
return SKIP_BODY;
} }
当我们在页面中运行该标签,代码如下
<%@ taglib uri=\
在页面中所显示的结果是
a) b) c) welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE welcome to SCCE
在J2EE中,使用过滤器时,可以在web.xml文件中的()元素中包括init-param元素。(选择一项) A、 B、 C、
filter
filter-mapping filter-name
d)
D、 filter-class J2EE中,()类的()方法用于创建会话对象.(选择一项) A、 B、 C、
HttpServletRequest,getSession HttpServletResponse ,getSession HttpSession,newInstance
D、 HttpSession,getSession
给定一个servlet的doGet方法中的代码片段,如下: request.setAttribute(“name”,”zhang”); response.sendRedirect
(http://localhost:8989/servlet/MyServlet); 那么在MyServlet中使用()方法将name属性的值取出来。 A、 B、 C、 D、
String str=request.getAttribute(“name”); String str=(String)request.getAttribute(“name”); Object str=request.getAttribute(“name”); 无法取出来
在J2EE中,以下对RequestDispatcher描述正确的是。(选择二项)
A、 jsp中有个隐含的默认对象dispatcher,它的类型是RequestDispatcher
B、 HttpServletRequest有一个方法:getRequestDispatcher,可以返回C、 D、
RequestDispatcher对象
RequestDispatcher有一个方法,forward可以把请求继续传递给别的jsp或者servlet
Jsp中有隐含的默认对象request,它的类型是RequestDispatcher