Check for a behavior change for included JSP encoding

This rule flags statically included JSP files that have a different encoding from the including JSP (the parent JSP). In JSP 1.2, page encoding was done on a per translation unit basis. In JSP 2.0, it is done on a per-file basis.

For example, if a.jsp statically includes b.jsp, and a page encoding is specified in a.jsp but not in b.jsp:

This rule determines the JSP encoding by:

1. Checking the JSP contentType charset.

Example: <%@ page contentType="text/html;charset=UTF-8"%>

2. If not found from contentType, then checking the pageEncoding.

Example: <%@ page pageEncoding="UTF-8"%>

3. If not found, it uses the default character set ISO-8859-1.

Example of statically included JSP files:
<%@ include file="copyright.jsp"%>

For additional information, see