单项选择题在j2ee中,mywebapp目录是一个web应用程序根目录,当在浏览器中输入http://localhost:8080/mywebapp/时,会自动打开该目录下的start.jsp文家。为了达到这个要求,需要在web.xml中添加如下代码() 

A.<welcome-file>start.jsp</welcome.-file> 
B.<welcome-file-list> start.jsp </welcome.-file-list> 
C.<welcome-file><welcome-file> start.jsp</welcome-file> </welcome.-file> 
D.<welcome-file-list><welcome-file> start.jsp </welcome.-file></welcome-file-list>


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Servlet服务结束,servlet会调用()方法释放资源 

A.free(0)
B.free(ServletConfig config)
C.destroy
D.destroy(ServletConfig config)

2.单项选择题在j2ee中,在mysample.java中包含代码:system.out.println(InetAddress.getByName(“aaaa”)).getHostAddress()),但在网络上没有aaaa这台主机。那么该行代码会() 

A.编译运行后什么都不显示
B.编译运行后显示“aaaa”字符文本
C.编译不能通过
D.编译运行后会抛出java.net.UnlnownHostExceptioon异常

3.单项选择题在J2EE中,以下各项中,()正确阐述了创建inputstreamreader的方式 

A.new InputStreamReader(new  FileInputStream(“data”))
B.new InputStreamReader (new  FileReader(“data”))
C.new InputStreamReader (new  BufferedReader(“data”))
D.new InputStreamReader ( “data”)

4.单项选择题

在j2ee中,有如下代码在servlet1.java中 
Important javax.servelt.*; 
Important javax.servlet.http.* 
Import java.io.ioexception 
Import java.io.printwriter 
Public class servlet1 extends httpservlet{ 
Public void init() throws serveltexception{ } 
Public void service(httpservelt request request,httpserbletresponse response)throws servletexception,ioexception{  
Printwriter out=response.getwriter();  
Out.println(“hello”); } } 
假如编译serblet 要具备的环境都已经建立好,现在用完全正确的命令编译该文件,对于以下陈述正确的是() 

A.编译该文件时会提示缺少doget()或者dopost()方法,编译不能够成功通过
B.编译后,把servlet1.class放在正确位置,在浏览器中查看该servlet1,会看到输出文字:“hello”
C.编译后,把servlet1.class放在正确位置,在浏览器中查看该servlet1,却看不到任何输出的文字
D.编译后,把servlet1.class放在正确位置,在浏览器中查看该servlet1,却看到产生运行时错误的出差信息

5.单项选择题在Java中,关键字()使类不能派生出子类 

A.final
B.public
C.private
D.valatile
E.native

6.单项选择题在J2EE中,套接字包括() 

A.仅端口号
B.仅IP地址
C.端口号和IP地址
D.都不是

7.单项选择题在J2EE中,要等待客户机请求连接,服务器可以使用以下()类 

A.Socket
B.ServerSocket
C.Server
D.URL

8.单项选择题在J2EE中,在web.xml中,有如下代码:30以下描述正确的是()

A.定义了默认的会话超时时长,时长为30秒
B.可以使用httpsession类的getMaxInactiveInterval()方法把该值取出来
C.定义了默认的会话超时时长,时长为30小时
D.可以使用Session类的getMaxInactiveInterval()刚发把该值取出来

9.单项选择题在J2EE中,在JSP中想要使用JavaBean:mypackage.mybean,则一下写法正确的是() 

A.<jsp:usebean id=”mybean” scope=”page” class=”mypackage.mybean”/> 
B.<jsp:useBean class=”mypackage.mybean.class”/> 
C.<jsp:usebean id=”mybean” class=”mypackage.mybean”/> 
D.<jsp:useBean id=”mybean” class=”mypackage..mybean”>

10.单项选择题J2EE中,对于简单属性的方法:public Color getColor(){……}和 public void setColor(Color c){……}假定color是类中的属性,在方法体内可以() 

A.在getColor方法体内只能有一行代码:return color;在setColor方法体内只能有一行代码:this.color=c
B.在getColor方法体内只能有一行代码:return color;在setColor方法体内一定要有该行代码:this.color=c;但还可以有其它的代码
C.在getColor方法体内一定要 有该行代码:return Color;但还可以有其它的代码,在setColor方法体内只能有一行代码:this.color=c
D.在getColor方法体内一定要有该行代码