Hi Jerry,
Given four JSP files arranged in the following directory hierarchy, identify the correct action that should be defined in acme/detonate.jsp to display 'click' when coyote.jsp is requested.
coyote.jsp
dynamite.jsp
acme/detonate.jsp
acme/dynamite.jsp
coyote.jsp contains <%@ include file="acme/detonate.jsp %>
dynamite.jsp contains boom!!!
acme/dynamite.jsp contains click
Possible answers:
1 <jsp:include page="dynamite.jsp"/>
2 <jsp:include page="acme/dynamite.jsp"/>
3 <jsp:include page="../dynamite.jsp"/>
4 <jsp:include file="dynamite.jsp" /> <%@include will include the code statically. We need to write something in acme/detonate.jsp. But, the code of this file is now the part of coyate.jsp directly. So, the line <jsp:include page="acme/dynamite.jsp" /> is the part of coyate.jsp
not acme/detonate.jsp. Now, it is easy to see from coyate.jsp that it should be the choice 2.
Thanks.