网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
在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的值取出来。 A.Stringstr=request.getAttribute(jb);B.Stringstr=(String)request.getAttribute(jb);C.Objectstr=request.getAttribute(jb);D.取不出来 ” 相关考题
考题 在J2EE中,Servlet1的代码如下:importjavax.servlet.*;importjavax.servlet.http.*;importjava.io.*;publicclassServlet1extendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType(text/html);PrintWriterout=response.getWriter();Stringaa=request.getQueryString();Stringbb=request.getMethod();out.println(aa);out.println(bb);}}把Servlet1.class文件放在Web服务器适合的目录下,在浏览B器地址栏内输入:http://localhost:8080/servlet/Servlet1?name=jb-aptechphone=12345678,看到的结果是()。A.name=jb-aptechphone=12345678GETB.name=jb-aptech,phone=12345678GETC.jb-aptech,12345678POSTD.name,phoneGETE.2,POST

考题 在j2ee中,有如下代码在servlet1.java中Importantjavax.servelt.*;Importantjavax.servlet.http.*Importjava.io.ioexceptionImportjava.io.printwriterPublicclassservlet1extendshttpservlet{Publicvoidinit()throwsserveltexception{}Publicvoidservice(httpserveltrequestrequest,httpserbletresponseresponse)throwsservletexception,ioexception{Printwriterout=response.getwriter();Out.println(hello”);}}假如编译serblet要具备的环境都已经建立好,现在用完全正确的命令编译该文件,对于以下陈述正确的是()A.编译该文件时会提示缺少doget()或者dopost()方法,编译不能够成功通过B.编译后,把servlet1.class放在正确位置,在浏览器中查看该servlet1,会看到输出文字:“hello”C.编译后,把servlet1.class放在正确位置,在浏览器中查看该servlet1,却看不到任何输出的文字D.编译后,把servlet1.class放在正确位置,在浏览器中查看该servlet1,却看到产生运行时错误的出差信息

考题 在PowerPoint 2003中,删除幻灯片的操作可以是()。A.单击常用工具栏中的quot粘贴quot按钮B.选择quot编辑quot菜单中的quot删除幻灯片quot选项C.选择quot编辑quot菜单中的quot清除quot选项D.单击常用工具栏中的quot复制quot按钮

考题 在PowerPoint 2003启动幻灯片放映的操作中,错误的是()。A.单击演示文稿窗口左下角的quot幻灯片放映quot视图按钮B.选择quot幻灯片放映quot菜单中的quot观看放映quot命令C.选择quot幻灯片放映quot菜单中的quot幻灯片放映quot命令D.按F5键

考题 在PowerPoint中,若想给“文本框”对象或“文本框占位符”设置动画效果,下列说法正确是()。A.执行quot格式quot菜单的quot幻灯片设计quot命令,右侧有一个相应的设置窗格B.执行quot幻灯片反映quot菜单的quot自定义动画quot命令,右侧有一个相应的设置窗格C.执行quot格式quot菜单的quot幻灯片版式quot命令,右侧有一个相应的设置窗格D.以上说法全错

考题 给定一个 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.无法取出来

考题 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.无法取出来

考题 给定一个 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.无法取出来

考题 在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.取不出来