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

Receive form data in Spring Boot POST request #318

Open
Lakinator opened this issue Jan 16, 2024 · 3 comments
Open

Receive form data in Spring Boot POST request #318

Lakinator opened this issue Jan 16, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Lakinator
Copy link

I'm trying to receive the data from a form submitted as a POST request.
Currently my workaround is to get the values from HttpServletRequest request and its parameter map.
But i want to directly bind the returned values to a dto object like e.g. here: https://www.baeldung.com/spring-mvc-and-the-modelattribute-annotation
Does binding an entity to a form work in jte?

@casid
Copy link
Owner

casid commented Jan 19, 2024

jte is a template engine and has no idea about Spring.

I don't use Spring at all, maybe the jte Spring Boot Starter covers this, but I'm not sure.

@casid casid added the question Further information is requested label Jan 19, 2024
@Lakinator
Copy link
Author

I currently use regular RequestParams in Spring, but e.g. JSP ha support for binding a model to form elements. Maybe this could be implemented for jte in the spring boot starter as well

@tschuehly
Copy link
Contributor

I currently use regular RequestParams in Spring, but e.g. JSP ha support for binding a model to form elements. Maybe this could be implemented for jte in the spring boot starter as well

Would be a nice idea! Thymeleaf has th:field aswell:

which expands to:

https://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants