You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2023/10/28 15:19:27 UTC
(struts-site) branch feature/include-tag-params created (now 429bb13d0)
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a change to branch feature/include-tag-params
in repository https://gitbox.apache.org/repos/asf/struts-site.git
at 429bb13d0 Clarifies how to access parameters in the included page
This branch includes the following new commits:
new 429bb13d0 Clarifies how to access parameters in the included page
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(struts-site) 01/01: Clarifies how to access parameters in the included page
Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch feature/include-tag-params
in repository https://gitbox.apache.org/repos/asf/struts-site.git
commit 429bb13d0432e8cca7f3af448e62f17fe8fcac42
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Sat Oct 28 17:19:19 2023 +0200
Clarifies how to access parameters in the included page
---
source/tag-developers/include-tag.md | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/source/tag-developers/include-tag.md b/source/tag-developers/include-tag.md
index 514231de3..8d7c9babc 100644
--- a/source/tag-developers/include-tag.md
+++ b/source/tag-developers/include-tag.md
@@ -18,11 +18,19 @@ Please make sure you have read the [Tag Syntax](tag-syntax) document and underst
> through the `<s:property.../>` tag since no ValueStack will be created. You can, however, access them in a servlet
> via the HttpServletRequest object or from a JSP page via a scriptlet.
-**How To access parameters**
+### How to access parameters
Parameters are passed as request parameters, so use the `${param.ParamName}` notation to access them. Do not use
the **property** tag to access parameters in included files.
+Below it's an example how you can access parameters passed into the included page:
+
+```
+<s:set var="paramName" scope="page">${param.ParamName}</s:set>
+```
+
+> **Note**: You can access such params without using JSTL, just use `${param.ParamName}` notation in Struts tags.
+
## Attributes
{% remote_file_content https://raw.githubusercontent.com/apache/struts/master/core/src/site/resources/tags/include-attributes.html %}
@@ -46,7 +54,7 @@ do an include myJsp.jsp page
</s:include>
```
-do an include to myJsp.jsp page with parameters `param1=value1` and `param2=value2`
+do an include to `myJsp.jsp` page with parameters `param1=value1` and `param2=value2`
**Example 3**
@@ -57,4 +65,4 @@ do an include to myJsp.jsp page with parameters `param1=value1` and `param2=valu
</s:include>
```
-do an include to myJsp.jsp page with parameters `param1=value1` and `param2=value2`
+do an include to `myJsp.jsp` page with parameters `param1=value1` and `param2=value2`