Issue 15254 docs issues tag library documentation#15304
Merged
matrei merged 7 commits intoapache:7.0.xfrom Jan 15, 2026
Merged
Conversation
Issue:
apache#15254
Fixes:
- Links are broken in 'request', 'response', 'servletContext'
and 'session' pages
Examples of using inherited properties in Tag Libraries used Controllers, now they are TagLib examples
jdaugherty
approved these changes
Dec 26, 2025
Contributor
|
FYI: The tests failed due to the ASF repo being down (unrelated to this PR). |
matrei
requested changes
Jan 13, 2026
Contributor
matrei
left a comment
There was a problem hiding this comment.
Thanks for taking this on!
Co-authored-by: Mattias Reichel <mattias.reichel@gmail.com>
Co-authored-by: Mattias Reichel <mattias.reichel@gmail.com>
Co-authored-by: Mattias Reichel <mattias.reichel@gmail.com>
matrei
reviewed
Jan 13, 2026
Comment on lines
+38
to
+54
| // List all attributes and their values for the current session | ||
| def listSessionAttributes = { Map params -> | ||
| out << params.get("name") << ' : ' << session.getAttribute(params.get("name")) | ||
| } | ||
|
|
||
| } | ||
| ---- | ||
|
|
||
| [source,xml] | ||
| ---- | ||
| <ul> | ||
| <g:each var="elm" in="${session.getAttributeNames()}"> | ||
| <li><g:listSessionAttributes name="${elm}" /></li> | ||
| </g:each> | ||
| </ul> | ||
| ---- | ||
|
|
Contributor
There was a problem hiding this comment.
Hmm, I struggle to see the logic in this example. Making easy/clear examples is hard.
Suggestion:
class ExampleTagLib {
def oncePerSession = { Map attrs, body ->
def key = (attrs.key ?: 'default').toString()
def sessionKey = "taglib.oncePerSession.${key}"
if (!session.getAttribute(sessionKey)) {
session.setAttribute(sessionKey, true)
out << body()
}
}
}<g:oncePerSession key="promo">
<div class="promo">Free shipping this week!</div>
</g:oncePerSession>
jdaugherty
approved these changes
Jan 14, 2026
Contributor
jdaugherty
left a comment
There was a problem hiding this comment.
This is such an improvement already, I'm good with it. I like Mattias's suggestion on the better example too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
As reported in this issue #15254