Fork me on GitHub

PMD Rulesets index: Current Rulesets

List of rulesets and rules contained in each ruleset.

  • Basic JSF: Rules concerning basic JSF guidelines.
  • Basic JSP: Rules concerning basic JSP guidelines.

Basic JSF (jsp)

Basic JSP (jsp)

  • NoLongScripts: Scripts should be part of Tag Libraries, rather than part of JSP pages.
  • NoScriptlets: Scriptlets should be factored into Tag Libraries or JSP declarations, rather than being part of JSP pages.
  • NoInlineStyleInformation: Style information should be put in CSS files, not in JSPs. Therefore, don’t use <B> or <FONT> tags, or attributes like “align=‘center’”.
  • NoClassAttribute: Do not use an attribute called ‘class’. Use “styleclass” for CSS styles.
  • NoHtmlComments: In a production system, HTML comments increase the payload between the application server to the client, and serve little other purpose. Consider switching to JSP comments.
  • JspEncoding: A missing ‘meta’ tag or page directive will trigger this rule, as well as a non-UTF-8 charset.
  • NoInlineScript: Avoid inlining HTML script content. Consider externalizing the HTML script using the ‘src’ attribute on the “script” element.Externalized script could be reused between pages. Browsers can also cache the script, reducing overall download bandwidth.
  • NoUnsanitizedJSPExpression: Avoid using expressions without escaping / sanitizing. This could lead to cross site scripting - as the expressionwould be interpreted by the browser directly (e.g. “”).