You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a spring-boot web application running as a war file on tomcat using JSP's for templates.
If I try to output the UUID in my JSP using something like ${myObject.id} it displays the UUID.
Other things are working properly. If I put the converted UUID in the URL it gets converted. If I use the Spring Form tags using something like <form:input path="id" type="hidden"/> it gets converted to a friendly ID and when posting the form
I created a tag to do the conversion but was wondering if there was a better way?
The text was updated successfully, but these errors were encountered:
I've done a proof of concept with friendly-id with spring with both server pages and rest endpoints, and for rendering friendly-ids in my server rendered pages, I had to use DTOs instead of passing directly domain objects. Here's an example, whenever I need to pass model attributes to pages, I'm converting to DTOs:
And in the mappers (I'm using mapstruct), every time there is an UUID to be converted to String, the mappers have to use Friendly-Id to do the conversion:
Controllers are ok when you are expecting UUIDs, and they receive a friendly-id, they do the conversion ok, but, you have to be careful with redirections, then you have to explicitly convert the id to build the url string chain.
In this example the **bookService.createBook(...)" returns an UUID, so I have to convert it explicitly in order to get the expected shorten url.
I have a spring-boot web application running as a war file on tomcat using JSP's for templates.
If I try to output the UUID in my JSP using something like ${myObject.id} it displays the UUID.
Other things are working properly. If I put the converted UUID in the URL it gets converted. If I use the Spring Form tags using something like <form:input path="id" type="hidden"/> it gets converted to a friendly ID and when posting the form
I created a tag to do the conversion but was wondering if there was a better way?
The text was updated successfully, but these errors were encountered: