Rules available in this category:
Severity:
Critical
Rule:
Avoid duplicate local variable names in JSP. This can happen when other JSPs are included.
Reason:
Avoid duplicate local variable names in JSP. This can happen when other JSPs are included.
Usage Example:
one.jsp
<%@ include file="two.jsp" %>
<%
int var = 0; // VIOLATION
%>
two.jsp
<%
int var = 0;
%>
Should be written as:
Reference:
Severity:
Critical
Rule:
Detects the infinite loop caused by including JSPs.
Reason:
Detects the infinite loop caused by including JSPs.
Usage Example:
one.jsp
<%@ include file="two.jsp" %>
...
two.jsp
<%@ include file="three.jsp" %>
...
three.jsp
<%@ include file="one.jsp" %>
...
Should be written as:
Reference:
Severity:
Critical
Rule:
Avoid duplicate field names in JSP. This can happen when other JSPs are included.
Reason:
Avoid duplicate field names in JSP. This can happen when other JSPs are included.
Usage Example:
one.jsp
<%@ include file="two.jsp" %>
<%!
int fld = 0; // VIOLATION
%>
two.jsp
<%!
int fld = 0;
%>
Should be written as:
Reference:
Severity:
High
Rule:
Avoid duplicate imports in JSP.
Reason:
Avoid duplicate imports in JSP.
Usage Example:
<%@ page import=\"com.foo.MyClass,com.foo.MyClass\"%> // VIOLATION
//...
Should be written as:
<%@ page import=\"com.foo.MyClass\"%> // FIXED
//...
Reference:
Not Available.
Severity:
Critical
Rule:
Avoid duplicate methods in JSP. This can happen when other JSPs are included.
Reason:
Avoid duplicate methods in JSP. This can happen when other JSPs are included.
Usage Example:
one.jsp
<%@ include file="two.jsp" %>
<%!
public void foo() // VIOLATION
{
...
}
%>
two.jsp
<%!
public void foo() // VIOLATION
{
...
}
%>
Should be written as:
Reference:
Severity:
Critical
Rule:
Never use local variable names used by servelts, since this can result in duplicate variable names.
Reason:
Never use local variable names used by servelts, since this can result in duplicate variable names.
Usage Example:
one.jsp
<%
int request = -1; //VIOLATION
%>
Should be written as:
Reference:
Severity:
Medium
Rule:
Never use local variable names used by servelts, since this can result in duplicate variable names.
Reason:
Never use local variable names used by servelts, since this can result in duplicate variable names.
Usage Example:
<html>
<head>
<title>Notice and Result</title>
</head>
<body topmargin=0>
....
</body>
</html>
Should be written as:
<%-- This JSP displays the login form --%>
<html>
<head>
<title>Notice and Result</title>
</head>
<body topmargin=0>
....
</body>
</html>
Reference: