[struts-site] branch fixes-tags created (now 91e0cbf)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch fixes-tags in repository https://gitbox.apache.org/repos/asf/struts-site.git. at 91e0cbf Cleans up tag syntax page This branch includes the following new commits: new 91e0cbf Cleans up tag syntax 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: Cleans up tag syntax page
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch fixes-tags in repository https://gitbox.apache.org/repos/asf/struts-site.git commit 91e0cbff09991a1038af3eaacfd87f8c8468345a Author: Lukasz Lenart AuthorDate: Wed Feb 19 08:32:48 2020 +0100 Cleans up tag syntax page --- source/tag-developers/tag-syntax.md | 132 ++-- 1 file changed, 51 insertions(+), 81 deletions(-) diff --git a/source/tag-developers/tag-syntax.md b/source/tag-developers/tag-syntax.md index 5f28e45..18ad5a9 100644 --- a/source/tag-developers/tag-syntax.md +++ b/source/tag-developers/tag-syntax.md @@ -4,164 +4,134 @@ title: Tag Developers Guide --- # Tag Syntax +{:.no_toc} -The tags are designed to display dynamic data. To create a input field that displays the property "postalCode", we'd pass the String "postalCode" to the textfield tag. +* Will be replaced with the ToC, excluding a header +{:toc} -**Creating a dynamic input field** +The tags are designed to display dynamic data. To create a input field that displays the property "postalCode", +we'd pass the String "postalCode" to the textfield tag. +## Creating a dynamic input field ```jsp - - ``` -If there is a "postalCode" property on the value stack, its value will be set to the input field. When the field is submitted back to the framework, the value of the control will be set back to the "postalCode" property. - -Sometimes, we want to pass the dynamic data to a tag. For example, we might want to display a label with the input field, and we might want to obtain the label from the application's messages resources. Accordingly, the framework will parse expressions found in the tag attributes, so that we can merge dynamic data into the tag attributes at runtime. The expression escape sequence is "%{ ... }". Any text embedded in the escape sequence is evalulated as an expression. +If there is a "postalCode" property on the value stack, its value will be set to the input field. When the field is +submitted back to the framework, the value of the control will be set back to the "postalCode" property. -**Using an expression to set the label** +Sometimes, we want to pass the dynamic data to a tag. For example, we might want to display a label with the input +field, and we might want to obtain the label from the application's messages resources. Accordingly, the framework will +parse expressions found in the tag attributes, so that we can merge dynamic data into the tag attributes at runtime. +The expression escape sequence is `%{ ... }`. Any text embedded in the escape sequence is evalulated as an expression. +### Using an expression to set the label ```jsp - - ``` -The expression language ([OGNL](ognl.html)) lets us call methods and evaluate properties. The method `getText` is provided by ActionSupport, which is the base class for most Actions. Since the Action is on the stack, we can call any of its methods from an expression, including `getText`. +The expression language ([OGNL](ognl)) lets us call methods and evaluate properties. The method `getText` is provided +by `ActionSupport`, which is the base class for most Actions. Since the Action is on the stack, we can call any of its +methods from an expression, including `getText`. ## Non-String Attributes -The HTTP protocol is text-based, but some tags have non-String attribute types, like `bool` or `int`. To make using non-String attributes intuitative, the framework evaulates **all** non-String attributes as an expression. In this case, you do not need to use the escape notation. (But, if you do anyway , the framework will just strip it off.) - -**Evaluating booleans** +The HTTP protocol is text-based, but some tags have non-String attribute types, like `bool` or `int`. To make using +non-String attributes intuitative, the framework evaulates **all** non-String attributes as an expression. +In this case, you do not need to use the escape notation. (But, if you do anyway , the framework will just strip it off.) +### Evaluating booleans ```jsp - - ``` -Since the attribute `multiple` maps to a boolean property, the framework does not interpret the value as a String. The value is evaluated as an expression and automtically converted to a boolean. +Since the attribute `multiple` maps to a boolean property, the framework does not interpret the value as a String. +The value is evaluated as an expression and automtically converted to a boolean. Since it's easy to forget which attributes are String and which are non-String, you can still use the escape notation. -**Evaluating booleans (verbose)** - +### Evaluating booleans (verbose) ```jsp - - ``` -**Evaluating booleans (with property)** - +### Evaluating booleans (with property) ```jsp - - ``` -**Evaluating booleans (verbose with property)** - +### Evaluating booleans (verbose with propert
[struts-site] branch fixes-tags updated (91e0cbf -> d6cafe7)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch fixes-tags in repository https://gitbox.apache.org/repos/asf/struts-site.git. discard 91e0cbf Cleans up tag syntax page add 5b067f0 Update action-configuration.md add e4046ed Merge pull request #140 from Josh-Reichman/patch-1 add d6cafe7 Cleans up tag syntax page This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (91e0cbf) \ N -- N -- N refs/heads/fixes-tags (d6cafe7) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes: source/core-developers/action-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[struts-site] branch asf-staging updated: Updates stage by Jenkins
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-staging in repository https://gitbox.apache.org/repos/asf/struts-site.git The following commit(s) were added to refs/heads/asf-staging by this push: new c5e2af4 Updates stage by Jenkins c5e2af4 is described below commit c5e2af4e2d6e5bfbaaeeffa32ac9f4011320aefb Author: jenkins AuthorDate: Wed Feb 19 07:47:29 2020 + Updates stage by Jenkins --- content/core-developers/action-configuration.html | 2 +- content/core-developers/default-properties.html | 11 ++ content/core-developers/interceptors.html | 17 +- content/core-developers/struts-default-xml.html | 17 +- content/tag-developers/checkboxlist-tag.html | 2 +- content/tag-developers/tag-syntax.html| 186 +++--- 6 files changed, 126 insertions(+), 109 deletions(-) diff --git a/content/core-developers/action-configuration.html b/content/core-developers/action-configuration.html index ce881da..35b5878 100644 --- a/content/core-developers/action-configuration.html +++ b/content/core-developers/action-configuration.html @@ -212,7 +212,7 @@ to setting this property to true. Although action naming is pretty flexible, one should pay attention when using dots (eg. create.user) and/or dashes (eg. my-action). While the dot notation has no known side effects at this time, the dash notation will cause problems with the generated JavaScript for certain tags and themes. Use with caution, and always try to use camelcase action -names (eg. createUser) or underscores (eg. my-action). +names (eg. createUser) or underscores (eg. my_action). Allowed action names diff --git a/content/core-developers/default-properties.html b/content/core-developers/default-properties.html index fd6b3ac..447bfa1 100644 --- a/content/core-developers/default-properties.html +++ b/content/core-developers/default-properties.html @@ -366,6 +366,17 @@ struts.ognl.enableExpressionCache=true ### Indicates if Dispatcher should handle unexpected exceptions by calling sendError() ### or simply rethrow it as a ServletException to allow future processing by other frameworks like Spring Security struts.handle.exception=true + +### Applies maximum length allowed on OGNL expressions for security enhancement (optional) +### +### **WARNING**: If developers enable this option (by configuration) they should make sure that they understand the implications of setting +### struts.ognl.expressionMaxLength. They must choose a value large enough to permit ALL valid OGNL expressions used within the application. +### Values larger than the 200-400 range have diminishing security value (at which point it is really only a "style guard" for long OGNL +### expressions in an application. Setting a value of null or "" will also disable the feature. +### +### NOTE: The sample line below is *INTENTIONALLY* commented out, as this feature is disabled by default. +# struts.ognl.expressionMaxLength=256 + ### END SNIPPET: complete_file diff --git a/content/core-developers/interceptors.html b/content/core-developers/interceptors.html index 29e063a..81763ab 100644 --- a/content/core-developers/interceptors.html +++ b/content/core-developers/interceptors.html @@ -248,8 +248,8 @@ than reiterate the same list of Interceptors, we can bundle these Interceptors t @@ -280,13 +281,21 @@ than reiterate the same list of Interceptors, we can bundle these Interceptors t[struts-site] branch asf-staging updated: Updates stage by Jenkins This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-staging in repository https://gitbox.apache.org/repos/asf/struts-site.git The following commit(s) were added to refs/heads/asf-staging by this push: new 3fbf1b0 Updates stage by Jenkins 3fbf1b0 is described below commit 3fbf1b0c6f732a1107e03a2d19c0714ac274e800 Author: jenkins AuthorDate: Wed Feb 19 07:53:31 2020 + Updates stage by Jenkins --- content/tag-developers/tag-syntax.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/tag-developers/tag-syntax.html b/content/tag-developers/tag-syntax.html index 9d809dc..328a294 100644 --- a/content/tag-developers/tag-syntax.html +++ b/content/tag-developers/tag-syntax.html @@ -127,6 +127,8 @@ https://github.com/apache/struts-site/edit/master/source/tag-developers/tag-syntax.md"; title="Edit this page on GitHub">Edit on GitHub +<< back to Tag Developers Guide + Tag Syntax
[struts-site] branch fixes-tags updated (d6cafe7 -> a57b634)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch fixes-tags in repository https://gitbox.apache.org/repos/asf/struts-site.git. from d6cafe7 Cleans up tag syntax page add a57b634 Adds a dedicated layout for Tags guide No new revisions were added by this update. Summary of changes: source/_layouts/{plugin.html => tag-developers.html} | 2 +- source/tag-developers/tag-syntax.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) copy source/_layouts/{plugin.html => tag-developers.html} (94%)