matrei commented on code in PR #15304:
URL: https://github.com/apache/grails-core/pull/15304#discussion_r2685251631
##########
grails-doc/src/en/ref/Tag Libraries/flash.adoc:
##########
@@ -33,17 +33,20 @@ A temporary storage map that stores objects within the
session for the next requ
[source,groovy]
----
-class BookController {
+class ExamplesTagLib {
- def index() {
+ def message = {
flash.message = "Welcome!"
- redirect(action: 'home')
+ out << "Flash: ${flash}"
}
- def home() {}
}
----
+[source,xml]
+----
+<g:showRequest /> // Outputs "Flash: [message:Welcome!]"
Review Comment:
```suggestion
<g:showRequest /> <!-- Outputs "Flash: [message:Welcome!]" -->
```
##########
grails-doc/src/en/ref/Tag Libraries/session.adoc:
##########
@@ -25,30 +25,28 @@ under the License.
=== Purpose
-The {grailsdocs}ref/Servlet%20API/session.html[session] object is an instance
of the Servlet API's {javaee}javax/servlet/http/HttpSession.html[HttpSession]
class
+The link:{servletApiRefFromRef}session.html[session] object is an instance of
the Servlet API's {jakartaee}jakarta/servlet/http/HttpSession.html[HttpSession]
class
=== Examples
[source,groovy]
----
-class UserController {
+class ExampleTagLib {
- def logout() {
+ def logout = {
log.info "User agent: " + request.getHeader("User-Agent")
session.invalidate()
- redirect(action: "login")
}
Review Comment:
Does this example make sense for a taglib?
##########
grails-doc/src/en/ref/Tag Libraries/servletContext.adoc:
##########
@@ -25,33 +25,27 @@ under the License.
=== Purpose
-The link:{servletApiRefFromRef}servletContext.html[servletContext] object is
an instance of the Servlet API's
{javaee}javax/servlet/ServletContext.html[ServletContext] class.
+The link:{servletApiRefFromRef}servletContext.html[servletContext] object is
an instance of the Servlet API's
{jakartaee}jakarta/servlet/ServletContext.html[ServletContext] class.
=== Examples
[source,groovy]
----
-class BookController {
- def doSomething() {
- def input
- try {
- input =
servletContext.getResourceAsStream("/WEB-INF/myscript.groovy")
- def result = new GroovyShell().evaluate(input.text)
- render result
- }
- finally {
- input.close()
- }
+class ExamplesTagLib {
+
+ def doSomething = {
+ out << "Servlet major version: ${servletContext.majorVersion }"
Review Comment:
```suggestion
out << "Servlet major version: ${servletContext.majorVersion}"
```
##########
grails-doc/src/en/ref/Tag Libraries/pageScope.adoc:
##########
Review Comment:
```suggestion
<g:child /> <!-- Outputs "My parent is John" -->
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]