Skip to content

Commit

Permalink
Qute docs - describe solutions for native executables
Browse files Browse the repository at this point in the history
- related to quarkusio#20469 and quarkusio#20421

(cherry picked from commit 4d76a66)
  • Loading branch information
mkouba authored and gsmet committed Oct 18, 2021
1 parent 53ca838 commit 08eccf3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/src/main/asciidoc/qute-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,22 @@ class Item {
----
<1> The generated value resolver knows how to invoke the `BigDecimal.setScale()` method.

[[native_executables]]
=== Native Executables

In the JVM mode a reflection-based value resolver may be used to access properties and call methods of the model classes.
But this does not work for <<building-native-image.adoc,a native executable>> out of the box.
As a result, you may encounter template exceptions like `Property "name" not found on the base object "org.acme.Foo" in expression {foo.name} in template hello.html` even if the `Foo` class declares a relevant getter method.

There are several ways to solve this problem:

* Make use of <<typesafe_templates,type-safe templates>> or <<typesafe_expressions,type-safe expressions>>
** In this case, an optimized value resolver is generated automatically and used at rutime
** This is the preferred solution
* Annotate the model class with <<template_data,`@TemplateData`>> - a specialized value resolver is generated and used at rutime
* Annotate the model class with `@io.quarkus.runtime.annotations.RegisterForReflection` to make the reflection-based value resolver work


[[resteasy_integration]]
=== RESTEasy Integration

Expand Down

0 comments on commit 08eccf3

Please sign in to comment.