A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pmd-code.org/latest/pmd_rules_jsp_errorprone.html below:

Error Prone | PMD Source Code Analyzer

Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.

Table of Contents JspEncoding

Since: PMD 4.0

Priority: Medium (3)

A missing ‘meta’ tag or page directive will trigger this rule, as well as a non-UTF-8 charset.

This rule is defined by the following XPath expression:

//CompilationUnit/Content[
not(Element[@Name="meta"][
   Attribute[@Name="content"]/AttributeValue[contains(lower-case(@Value),"charset=utf-8")]
])
and
    not(JspDirective[@Name='page']/JspDirectiveAttribute[@Name='contentType'][contains(lower-case(@Value),"charset=utf-8")])
]

Example(s):

Most browsers should be able to interpret the following headers:

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

<meta http-equiv="Content-Type"  content="text/html; charset=UTF-8" />

Use this rule by referencing it:

<rule ref="category/jsp/errorprone.xml/JspEncoding" />

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4