在J2EE中,在Servlet1中的doGet和doPost方法中只有如下代码:request.setAttribute("jb","aptech");response.sendRedirect("http://localhost:8080/servlet/Servlet2");那么在Servlet2中使用()可以把属性jb的值取出来。A.Stringstr=request.getAttribute("jb");B.Stringstr=(String)request.getAttribute("jb");

题目
在J2EE中,在Servlet1中的doGet和doPost方法中只有如下代码:request.setAttribute("jb","aptech");response.sendRedirect("http://localhost:8080/servlet/Servlet2");那么在Servlet2中使用()可以把属性jb的值取出来。

A.Stringstr=request.getAttribute("jb");

B.Stringstr=(String)request.getAttribute("jb");

C.Objectstr=request.getAttribute("jb");

D.取不出来


相似考题
更多“在J2EE中,在Servlet1中的doGet和doPost方法中只有如下代码:request.setAttribute("jb","aptech");response.sendRedirect("http://localhost:8080/servlet/Servlet2");那么在Servlet2中使用()可以把属性jb的值取出来。 ”相关问题
  • 第1题:

    在PowerPoint中,若想给“文本框”对象或“文本框占位符”设置动画效果,下列说法正确是()。

    A.执行quot格式quot菜单的quot幻灯片设计quot命令,右侧有一个相应的设置窗格

    B.执行quot幻灯片反映quot菜单的quot自定义动画quot命令,右侧有一个相应的设置窗格

    C.执行quot格式quot菜单的quot幻灯片版式quot命令,右侧有一个相应的设置窗格

    D.以上说法全错


    参考答案B

  • 第2题:

    2、给定一个 Servlet 的doGet方法中的代码片段,如下: request.setAttribute(“name”,”zhang”); response.sendRedirect(“http://localhost:8080/servlet/MyServlt”); 那么在 MyServlet 中可以使用()方法把属性 name的值取出来。

    A.String str=request.getAttribute(“name”);

    B.String str=(String)request.getAttribute(“name”);

    C.Object str=request.getAttribute(“name”);

    D.无法取出来


    Stringstr=request.getAttribute(“name”);

  • 第3题:

    在servlet中的doGet和doPost方法中只有如下代码:() request.setAttribute(”jb”,”aPtech”); response.sendRedirect(”http://localhost:8080/servlet/Servlet2”);那么在Servlet2中使用()可以把属性jb的值取出来

    A.String str=request.getAttribute(“jb”);

    B.String sir=(String)request.getAttribute(“jb”);

    C.Object str=request.getAttribute(“jb“);

    D.取不出来


    D

  • 第4题:

    给定一个 Servlet 的 doGet 方法中的代码片段,如下: request.setAttribute(“name”,”zhang”); response.sendRedirect(“http://localhost:8080/servlet/MyServlt”); 那么在 MyServlet 中可以使用()方法把属性 name 的值取出来。

    A.String str=request.getAttribute("name");

    B.String str=(String)request.getAttribute("name");

    C.Object str=request.getAttribute("name");

    D.无法取出来


    D

  • 第5题:

    给定一个 Servlet 的doGet方法中的代码片段,如下: request.setAttribute(“name”,”zhang”); response.sendRedirect(“http://localhost:8080/servlet/MyServlt”); 那么在 MyServlet中可以使用()方法把属性 name的值取出来。

    A.String str=request.getAttribute(“name”);

    B.String str=(String)request.getAttribute(“name”);

    C.Object str=request.getAttribute(“name”);

    D.无法取出来


    无法取出来