rspec/rules/S1937/html/rule.adoc

33 lines
834 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Content that doesn't change or that doesn't change often should be included using a mechanism which won't try to interpret it. Specifically, ``++<%@ include file="..." %>++``, which includes the file in the JSP servlet translation phase (i.e. it happens once), should be used instead of ``++<jsp:include page="..." />++``, which includes the page on the file, when the content is being served to the user.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,html]
2021-04-28 16:49:39 +02:00
----
<jsp:include page="header.jsp"> <!-- Noncompliant -->
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,html]
2021-04-28 16:49:39 +02:00
----
<%@ include file="header.jsp" %>
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use an include action instead of an include directive.
endif::env-github,rspecator-view[]