Friends,
here is one more question from Jpilot-
What is the result displayed on the browser when the First.jsp is accessed.
First.jsp
<%@ page language="java" import="com.mypackage.MyBean" %>
<
jsp:useBean id="myBean" class="MyBean" scope="session" />
<jsp:setProperty name="myBean" property="myProperty" value="FirstValue"/>
<jsp:include page="Second.jsp"/>
<jsp:getProperty name="myBean" property="myProperty"/>
Second.jsp
<%@ page language="java" import="com.mypackage.MyBean" %>
<jsp:useBean id="myBean" class="MyBean" scope="application"/>
<jsp:setProperty name="myBean" property="myProperty" value="SecondValue"/>
A.
Translation Error
B.
Compilation Error
C.
Runtime Error
D.
Prints FirstValue
E.
Prints SecondValue
ans:compilation error
why would there be a compilation error as said in the ans??
as it is <jsp:include page="Second.jsp"/> , only the output is included in the page.and therefore should not be any problem with second import..
thanks,
mallika