From d005cff7c214ce5c324455fc16dcacd28f66e746 Mon Sep 17 00:00:00 2001 From: scsc Date: Wed, 11 Sep 2024 18:50:55 +0200 Subject: [PATCH] docs: multi-line import example for page directive (#464) * docs: multi-line import example for page directive * docs: add necessary backslash in multi-line page import --- src/main/docs/guide/GSPBasics/pageDirectives.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/docs/guide/GSPBasics/pageDirectives.adoc b/src/main/docs/guide/GSPBasics/pageDirectives.adoc index 0a5b457f4d..cb0d4a353f 100644 --- a/src/main/docs/guide/GSPBasics/pageDirectives.adoc +++ b/src/main/docs/guide/GSPBasics/pageDirectives.adoc @@ -7,6 +7,16 @@ The import directive lets you import classes into the page. However, it is rarel <%@ page import="java.awt.*" %> ---- +Separate imports with semicolons `;`. As a convention, you should split larger number of imports into separate lines to improve readability, which requires adding backslash `\` at the end of each line: + +[,xml] +---- +<%@ page import="java.awt.*; \ +your.custom.ComponentA; \ +your.custom.ComponentB;" +%> +---- + GSP also supports the contentType directive: [,xml]