The page attribute of both the jsp:include and the jsp:forward actions are interpreted relative to the current JSP page, while the file attribute in an include
directive is interpreted relative to the current JSP file.
Consider the following four situations built using four JSP files: A.jsp, C.jsp, dir/B.jsp and dir/C.jsp:
• A.jsp says <jsp:include page=”dir/B.jsp”/> and dir/B.jsp says <%@ include file=”C.jsp” %>. In this case the relative specification C.jsp resolves to dir/C.jsp.
• A.jsp says <%@ include file=”dir/B.jsp”%> and dir/B.jsp says <jsp:include page=”C.jsp”/>. In this case the relative specification C.jsp resolves to C.jsp.
? Can someone please clarify?
current JSP page and current JSP file
Sec 3.10.5 of the JLS says:
Strings computed by constant expressions (�15.28) are computed at compile time and then treated as if they were literals.
Strings computed at run time are newly created and therefore distinct.
Originally posted by Vlado Zajac
The error on first line is caused by trying to assign int to byte
You cannot assign an int which is not a compile-time constant in the range of byte into a byte without an explicit cast.
In the second line, it only matters that the type of the expression is int.
The compiler does not carry out any calculations. It is only checking type in this case.