Skip to content

Conversation

@mkouba
Copy link
Contributor

@mkouba mkouba commented Feb 13, 2025

@mkouba mkouba requested a review from ia3andy February 13, 2025 16:13
@quarkus-bot quarkus-bot bot added the area/qute The template engine label Feb 13, 2025
@mkouba
Copy link
Contributor Author

mkouba commented Feb 13, 2025

This should fix the problem but keep in mind that the template foo.1.html cannot be injected directly in a bean unless the @Location is used (or 1.html is registered as a supported suffix).

@ia3andy
Copy link
Contributor

ia3andy commented Feb 13, 2025

any reason not to use lastIndexOf? I guess it's probably better to use the config like you do..?

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 13, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit bfc17f6.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gsmet
Copy link
Member

gsmet commented Feb 13, 2025

This should fix the problem but keep in mind that the template foo.1.html cannot be injected directly in a bean unless the @location is used (or 1.html is registered as a supported suffix).

Not sure about lastIndexOf as you might have composite extensions but couldn't you try with 1.html and if not found and contains a dot, try with .html?

@mkouba
Copy link
Contributor Author

mkouba commented Feb 14, 2025

This should fix the problem but keep in mind that the template foo.1.html cannot be injected directly in a bean unless the @location is used (or 1.html is registered as a supported suffix).

Not sure about lastIndexOf as you might have composite extensions but couldn't you try with 1.html and if not found and contains a dot, try with .html?

I'm not sure I completely understand 🤔. In any case, this would not work if you have @Inject Template foo and multiple matching templates, e.g. foo.1.html and foo.2.html.

I'm using the quarkus.qute.suffixes here, because they're used when performing the lookup. For example, if you do @Inject Template foo then we attempt to find the templates matching the name foo, foo.qute.html, foo.qute.txt, foo.html and foo.txt by default. Afterwards, we can determine a specific template based on selected variant or simply take the first found (according to the ordering in quarkus.qute.suffixes).

@ia3andy
Copy link
Contributor

ia3andy commented Feb 14, 2025

I will give it a try today.. thanks @mkouba

@mkouba
Copy link
Contributor Author

mkouba commented Feb 14, 2025

I will give it a try today.. thanks @mkouba

Thanks, let me know... I tested this fix with your reproducer so it should be fine 😉.

Copy link
Contributor

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@ia3andy ia3andy merged commit 3c19a78 into quarkusio:main Feb 14, 2025
26 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 14, 2025
@gsmet gsmet modified the milestones: 3.21 - main, 3.19.0 Feb 14, 2025
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/bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error with Qute templates with dot in the names

3 participants