Saturday, March 14, 2009

How do you print the contents of a.jsp in b.jsp. How do you include the

Question :How do you print the contents of a.jsp in b.jsp. How do you include the
file? (JSP)

Answer :a.jsp
<%!
public int i=10;
%>
b.jsp
<%@ include file="a.jsp" %>
<%
out.println(i);
%>
do not use as this will include the file at runtime where as the above
includes (directive include) the file at compile time

No comments: