-
Notifications
You must be signed in to change notification settings - Fork 49
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
Handle flash attributes on htmx redirects #137
Handle flash attributes on htmx redirects #137
Conversation
@wimdeblauwe there is a limitation, because the flash attribute processing does not work if |
aac224b
to
8097ea9
Compare
8097ea9
to
a15d7c2
Compare
BTW @wimdeblauwe there is more magic done by RedirectView
We could support all of them to behave as similarly as possible to Spring. Let me know what you think about it. |
I couldn't find an alternative approach that was compatible with using JTE Models as the return. I'm happy to try another approach if you have any suggestions. |
@checketts let's move the discussion about an alternative approach to the initial issue #127. |
...ng-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/mvc/HtmxHandlerInterceptor.java
Show resolved
Hide resolved
If you are willing to implement that, it would be great if we align as much as possible with |
Sure, but let's merge this before and I'll create a separate PR for it. Okay? |
ok, but can we already merge this? Don't we need a solution to #127 first? |
I'm not sure because I need more information from @checketts on how he uses it in his projects. But if you ask me, we should revert #127 in favor of a better solution to his issue. It's definitely the wrong approach to render views in HtmxHandlerInterceptor#postHandle which was introduced by #127. And as far as I know, using See https://jte.gg/spring-boot-starter-3/ or https://github.com/casid/jte/tree/main/jte-spring-boot-starter-3/src/main/java/gg/jte/springframework/boot/autoconfigure for more information about integration with Spring Boot. |
Ok, I agree that maybe it was bad judgement to have #127. If we merge this, it means @checketts is not blocked for now and we can have flash attributes, just not the combination of flashattributes and #127, right? |
That's right. |
I'm OK with that trade off. Sorry I've not been able to contribute much (been away working on building a physical building) I'll re-open #127 and discuss the JTE specific needs and options there. |
This adds handling for flash attributes via
RedirectAttributes
. Now you can perform client-side redirects with htmx and the flash attributes work as with normal redirects.Fixes #96