Skip to content

Commit

Permalink
docs: multi-line import example for page directive (#464)
Browse files Browse the repository at this point in the history
* docs: multi-line import example for page directive

* docs: add necessary backslash in multi-line page import
  • Loading branch information
scscgit authored Sep 11, 2024
1 parent daab27e commit d005cff
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/docs/guide/GSPBasics/pageDirectives.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit d005cff

Please sign in to comment.