Posts by Jota Freitas Jr • 126 points
11 posts
-
0
votes1
answer54
viewsA: mvc input date is changing format when I change google Chrome language
Good morning, you can use the Moment JS to format the date and each change. Ex: $("input").on("change", function() { this.setAttribute( "data-date", moment(this.value, "YYYY-MM-DD") .format(…
-
0
votes1
answer291
viewsA: Error deploying with Tomcat 7
Well, first as you will deploy in an external container, mark the container dependency as provided, for example, in the pom.xmlchange the dependency to look like in the example below: <!-- marca…
-
0
votes1
answer108
viewsA: Thymeleaf hide button
Good afternoon, you can put a Boolean flag in the controller that takes users to these pages and use the th:if whether or not to display the button. For example: <button…
-
0
votes1
answer107
viewsA: How to summarize a long text using Thymeleaf?
You can use the function abbreviate of expression #strings. For example: <p th:text="${#strings.abbreviate(resumo,5)} "></p> For more details on expressions see link…
-
1
votes1
answer110
viewsA: How can Maven’s archetype webapp work without web.xml?
To decrease the use of xml from Servlet 3.0 the use of web.xml is optional, as you can see in the archetype pom the dependency is above this: <dependency>…
-
2
votes1
answer832
viewsA: Error starting spring boot
I’ve had this problem, usually lack of dependency or wrong configuration of the local Maven repository, try deleting the dependencies related to Spring Boot and importing the project again so that…
-
2
votes2
answers1607
viewsA: Using Thymeleaf in Java Script code
Good afternoon, you can use Inline for Javascript, so you can access the view variables directly within the JS code. For example: <script th:inline="javascript"> /*<![CDATA[*/ ... var…
-
0
votes1
answer229
viewsA: Thymeleaf: how to insert one include inside another include?
You could include inside the footer fragment two other fragments and replace this with the th:replace as done with the footer. With the th:include the fragment will be placed inside the <div>…
thymeleafanswered Jota Freitas Jr 126 -
1
votes1
answer1598
viewsA: Can anyone explain what a Spring Framework bean is?
A bean is an object that is created, managed and destroyed by the spring container, the framework is fully responsible for this object, creating, injecting its properties (Dependency injection). We…
-
1
votes1
answer906
viewsA: Passing variable value obtained in one method to another method in Java
Good morning, creates a student class that will be your DTO and a function in the class that connects to the database that returns that student. Class Example: public class Aluno { private String…
-
1
votes1
answer495
viewsA: How to generate a dynamic link within a condition in Thymeleaf?
Good evening, you could use the if to check if it exists and put the td according to that condition. For example: <tbody> <tr> <td th:text="${movie.movieName}">The Force…