企业内高技能(JAVA)(三级)理论知识复习题.pdf
文本预览下载声明
企业内高技能(JAVA)(三级)理论知识复习题
代码 试题
假设标签描述文件放置在以下位置/WEB-INF/tld/example.tld 且包含ex:hello /
1
则以下哪些 JSP code 可放置在第一行,并且能正确调用该标签?
A. %@ taglib prefix=ex uri=/WEB-INF/tld %
B. %@ taglib uri=/WEB-INF/tld/example.tld %
C. %@ taglib prefix=ex uri=http://localhost:8080/tld/example.tld %
D. %@ taglib prefix=ex uri=/WEB-INF/tld /example.tld %.
Tomcat 的一个实例运行在本地计算机的端口 8080 处。该 Web 服务器实例中部署有一名为 MyWebApp 的
Web 应用,其部署描述符文件片断如下:
servlet
servlet-namehelloworldservlet/servlet-name
servlet-classcom.mycompany.servlet.HelloworldServlet/servlet-class
2 /servlet
servlet-mapping
servlet-namehelloworldservlet/servlet-name
url-pattern/helloworld/url-pattern
/servlet-mapping
仅根据这些片断判断,可用下列哪些 URI 访问本机的名为 helloworldservlet 的 Servlet?
A. http://com.mycompany.servlet.HelloworldServlet:8080
B. http://localhost:8080/helloworld
C. http://localhost:8080/MyWebApp/helloworld .
D. http://localhost:8080/MyWebApp/HelloworldServlet
E. http://localhost:8080/MyWebApp/com.mycompany.servlet.HelloworldServlet
F. http://localhost:8080/MyWebApp/com/mycompany/servlet/HelloworldServlet
某 Web 应用的 Web.xml 有以下片断。
filter
filter-nameLogFilter/filter-name
filter-classfilters.LogFilter/filter-class
/filter
3
filter-mapping
filter-nameLogFilter/filter-name
servlet-namemyServlet/servlet-name
/filter-mapping
则可以断定
A.该 Web应用中包含一类名为 LogFilter的过滤器 .
B.过滤器 LogFilter只对 myServlet起作用
C.可通过 URL: http://服务器名 :端口/LogFilter访问该过滤器
D.myServlet只拥有一个过滤器
TestSession 是位于 URL“/MyWebApp/testsession”的 HttpServlet 类。其所有成员定义如下:
public void init() throws ServletException { }
public void doPost
显示全部