org.sonar.l10n.web.rules.Web.MultiplePageDirectivesCheck.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-web-plugin Show documentation
Show all versions of sonar-web-plugin Show documentation
Enables scanning of HTML, and JSP/JSF files.
While you can use as many page
directives as you like, it is more readable to set multiple page attributes in a single directive.
The exception to this rule is when multiple packages are being imported. In that case, imports may be done in separate directives and all other
attributes should be set in a single, additional directive.
Noncompliant Code Example
<%@ page session="false" %>
<%@ page import="java.util.*" %>
<%@ page errorPage="error.jsp" %> <!-- Noncompliant -->
<%@ page import="java.text.*" %>
Compliant Solution
<%@ page session="false"
errorPage="error.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy