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_bestpractices.html below:

Best Practices | PMD Source Code Analyzer

Rules which enforce generally accepted best practices.

Table of Contents DontNestJsfInJstlIteration

Since: PMD 3.6

Priority: Medium (3)

Do not nest JSF component custom actions inside a custom action that iterates over its body.

This rule is defined by the following XPath expression:

//Element[ @Name="c:forEach" ] // Element[ @NamespacePrefix="h" or @NamespacePrefix="f" ]

Example(s):

<html>
  <body>
    <ul>
      <c:forEach items='${books}' var='b'>
        <li> <h:outputText value='#{b}' /> </li>
      </c:forEach>
    </ul>
  </body>
</html>

Use this rule by referencing it:

<rule ref="category/jsp/bestpractices.xml/DontNestJsfInJstlIteration" />
NoClassAttribute

Since: PMD 3.6

Priority: Medium High (2)

Do not use an attribute called ‘class’. Use "styleclass" for CSS styles.

This rule is defined by the following XPath expression:

//Attribute[ upper-case(@Name)="CLASS" ]

Example(s):

<HTML> <BODY>
<P class="MajorHeading">Some text</P>
</BODY> </HTML>

Use this rule by referencing it:

<rule ref="category/jsp/bestpractices.xml/NoClassAttribute" />

Since: PMD 3.6

Priority: Medium High (2)

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.

This rule is defined by the following XPath expression:

Example(s):

<HTML><title>bad example><BODY>
<!-- HTML comment -->
</BODY> </HTML>

<HTML><title>good example><BODY>
<%-- JSP comment --%>
</BODY> </HTML>

Use this rule by referencing it:

<rule ref="category/jsp/bestpractices.xml/NoHtmlComments" />
NoJspForward

Since: PMD 3.6

Priority: Medium (3)

Do not do a forward from within a JSP file.

This rule is defined by the following XPath expression:

//Element[ @Name="jsp:forward" ]

Example(s):

<jsp:forward page='UnderConstruction.jsp'/>

Use this rule by referencing it:

<rule ref="category/jsp/bestpractices.xml/NoJspForward" />

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