Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus Qute documentation Item/ItemResource guide issue (template-parameter-declarations) #31907

Closed
rlfaber opened this issue Mar 16, 2023 · 8 comments · Fixed by #31913
Closed
Labels
area/qute The template engine kind/bug Something isn't working

Comments

@rlfaber
Copy link

rlfaber commented Mar 16, 2023

Describe the bug

The Quarkus Qute is a nice templating engine and I need it to migrate an old service from jsp to something modern.
I was learning Qute from the standard guide, but it has a nasty bug that produced an obscure error message I couldn't figure out.
https://quarkus.io/guides/qute
ItemResource example has this bug in ItemResource java code.
public TemplateInstance get(Integer id)
Should be this:
public TemplateInstance get(@PathParam("id") Integer id)
How did I find the issue? (this version of the guide has the issue fixed)
https://quarkus.pro/guides/qute.html (This is not an official quarkus or red hat maintained site)

Expected behavior

ItemResource demo working

Actual behavior

ItemResource demo produced an obscure error

How to Reproduce?

Just follow the guide for the https://quarkus.io/guides/qute#template-parameter-declarations
that uses the Item.java and ItemResource.java, etc.

Output of uname -a or ver

Linux hostname 5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk 11.0.15 2022-04-19 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

gradle 7.6

Additional information

No response

@rlfaber rlfaber added the kind/bug Something isn't working label Mar 16, 2023
@quarkus-bot quarkus-bot bot added the area/qute The template engine label Mar 16, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 16, 2023

/cc @mkouba (qute)

@gastaldi
Copy link
Contributor

You don't need that if you compile with the parameters:

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
        <configuration>
          <compilerArgs>
            <arg>-parameters</arg>
          </compilerArgs>
        </configuration>
      </plugin>

Can you confirm you have that set in your project?

@rlfaber
Copy link
Author

rlfaber commented Mar 16, 2023

My issue is in the context of Gradle and I think I should be able to just enter the learning demonstration without having to add a special thing (parameters) when as a new learner of Qute, I would not know that... Don't you think the "pro" URL that has the @PathParam("id") Integer id, is included for a reason?

@gastaldi
Copy link
Contributor

I think we should clarify that in the documentation. The less code you need to write the better IMHO

@rlfaber
Copy link
Author

rlfaber commented Mar 16, 2023

Thanks... I only care about others learning Qute... there is very little documentation on Qute, the guide is supposed to get one started... I ended up learning 90% of what I needed from the Reference (https://quarkus.io/guides/qute-reference), like sections {#if controller.foo} ... {if/} for example. I don't want to learn about something so fundamental like {#if...} in the context of other extended features like Template extension methods..... that I decide not to use/learn yet. Yet I can only learn about it in the Reference.

@gastaldi
Copy link
Contributor

Thanks for your feedback, would you be interested in providing a pull request for this issue?

We are still improving our docs and any feedback helps 👍

@rlfaber
Copy link
Author

rlfaber commented Mar 16, 2023

Sorry... can't... not familiar enough with the pull request workflow... So this is just docs... it can wait a bit... Thanks again.

@mkouba
Copy link
Contributor

mkouba commented Mar 17, 2023

Thanks... I only care about others learning Qute... there is very little documentation on Qute, the guide is supposed to get one started... I ended up learning 90% of what I needed from the Reference (https://quarkus.io/guides/qute-reference), like sections {#if controller.foo} ... {if/} for example. I don't want to learn about something so fundamental like {#if...} in the context of other extended features like Template extension methods..... that I decide not to use/learn yet. Yet I can only learn about it in the Reference.

Yes, the Qute Reference Guide is the ultimate source of information. It starts with two simple examples, then followed by core features (like {#if}) and Quarkus integration (including extension methods). You know it's hard to choose the features that should be mentioned in the "getting started" guide. Ideally, we would have a dozen of "getting started" guides covering all important features. But that's a question of priorities, resources and community involvement ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants