英语和jsp好的高手进!拜托了
第一题
Your web application has a valid dd with a single <security-constraint> tag.
Within this tag exists:
- a single http method that declares GET
All of the resources in your application exist within directory1 and directory2 and the only defined roles are BEGINNER and EXPERT.
If you want to restrict BEGINNERs from using resources in directory2, which are true about the url and role tag(s) you should declare? (Choose all that apply.)
A. A single url tag should declare directory1 and a single role tag should declare EXPERT.
B. A single url tag should declare directory2 and a single role tag should declare EXPERT.
C. A single url tag should declare directory1 and a single role tag should declare BEGINNER.
D. A single url tag should declare directory2 and a single role tag should declare BEGINNER.
E. One url tag should declare ANY and its role tag should declare EXPERT, and another url tag should declare directory2 and its role tag should declare BEGINNER.
F. One url tag should declare both directories, and its role tag should declare EXPERT, and another url tag should declare directory1 and its role tag
上题为什么不选B(正确答案为D),题中要求限制BEGINNER啊,D选项不等于容许BEGINNER访问吗?
第二题
Given:
01. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
02.
03. <%
04. java.util.List books = new java.util.ArrayList();
05. // add line here
06. request.setAttribute("myFavoriteBooks", books);
07. %>
08.
09. <c:choose>
10. <c:when test="${not empty myFavoriteBooks}">
11. My favorite books are:
12. <c:forEach var="book" items="${myFavoriteBooks}">
13. <br/> * ${book}
14. </c:forEach>
15. </c:when>
16. <c:otherwise>
17. I have not selected any favorite books.
18. </c:otherwise>
19. </c:choose>
Which of the following lines of code, if inserted independently at Line 5, will cause the text within the c:otherwise tag to display? (Choose all that apply)
A. books.add("");
B. books.add(null);
C. books.clear();
D. books.add("Head First");
E. books = null;
答案是B、D,我十分不解为啥会选D,我认为C也对啊,E将books置为Null也可以通过empty的测试啊
第三题
<%= out.print('${something}')>这样对吗?EL可以写在里面吗?
欢迎高手前来赐教,感激不尽!