About Question enthuware.jwpv6.2.958 :
Posted: Sun Mar 09, 2014 1:56 pm
Hello Guys,
I was testing this question because I failed and I saw that explanation about this question is wrong. The explanation about include directive or says:
'Fact 2: Any page directive attribute except import can occur at most once in a translation unit.
Now, in this question, both the including and the included files have an errorPage directive. Thus, the resulting including file (companyhome.jsp) will contain 2 errorPage directives, which is wrong.'
About Fact 2, I say YES, Any page directive attribute can occur more that once in a translation unit. If you include the same error page in errorPage (companyhome.jsp or simpleerrorhandler.jsp) in both pages this works perfectly.
Best Regards,
Thiago (Brazil)
I was testing this question because I failed and I saw that explanation about this question is wrong. The explanation about include directive
Code: Select all
<@ include file=...
Code: Select all
<jsp:directive.include>
'Fact 2: Any page directive attribute except import can occur at most once in a translation unit.
Now, in this question, both the including and the included files have an errorPage directive. Thus, the resulting including file (companyhome.jsp) will contain 2 errorPage directives, which is wrong.'
Code: Select all
//In file companyhome.jsp:
<html>
<body>
Welcome to ABC Corp!
<%@ page errorPage="simpleerrorhandler.jsp" %>
<%@ include file="companynews.jsp" %>
</body>
</html>
//In file companynews.jsp:
<%@ page errorPage="advancederrorhandler.jsp" %>
<h3>Todays News</h3>
Code: Select all
//In file companyhome.jsp:
<html>
<body>
Welcome to ABC Corp!
<%@ page errorPage="[color=#FF0000]simpleerrorhandler.jsp[/color]" %>
<%@ include file="companynews.jsp" %>
</body>
</html>
//In file companynews.jsp:
<%@ page errorPage="[color=#FF0000]simpleerrorhandler.jsp[/color]" %>
<h3>Todays News</h3>
Thiago (Brazil)