I am new to coding generally, and have been working on a quiz program on HTML and CSS (data is from PostgreSQL, framework SpringBoot on Eclipse. PHP and JQuery not included in syllabus). Here’s my problem: Now I have a list of answers where the user will have to select from. Was hoping to have the colours of the button-like
Tag: thymeleaf
Spring. One-time add session attributes after authorization
Stack: Spring Security and Thymeleaf. I have the following problem: I want to show or not show some elements in all html templates depending on user’s role. So, I need a boolean variable “isAdmin” in all templates so that I can use it in conditions: Please help me find the best solution. What I tried: Option 1. I can add
How to set a object’s field using another objects field in thymeleaf
I’m trying to set boxes’ elements copied from medicineBox’s values like below. Can anyone help me in this. I need to post medicineOrder model to the controller I’m using two object here – medicine and medicineOrder ——————> Controller method to get the page ——————> thymeleaf html page —————> Controller method to handle the post request —————-> Class MedicineOrder Not able
How to fix Thymeleaf th:field unexpected error
I am new to Spring Boot and Thymeleaf. I tried to follow some example but got error as below with no any ideas… My Spring Boot version is 2.7.1 and Java 17 entity: controller: view: The th:field will get 500 internal error when I open this web page…. I’ve google and take a look in Thymeleaf document, but seems the
Spring Boot & Thymeleaf – Localized text does not appear
I am currently working on the localization of my (second) Spring Boot project. However, I have come to a halt after several hours of struggling: I am unable to get a user-editable Session localization. The problem appears to occur as soon as the user sends a GET request with the lang parameter. (travel down below to see the results I
Convert String to Money Thymeleaf
I am having a problem converting input String to money. I am creating a spring boot application with thymeleaf. I have a web page where user inputs the data and there is a particular field where he inputs the String and it needs to be converted to type joda.money as in my pojo class that field has money data type.
SpringBoot. Thymeleaf. How to make table’s column clickable to send request to Controller?
I’ve created table with 8 columns: In fact each column (tag “td”) should serve as a button and after clicking send me to controller (@PostMapping or @GetMapping), where I will try to read th:value. How to make it? Instead of th:attr=”action=@{/}” I’ve tried to use th:href=”@{/}” – does not work. I’ve tried to insert between tags “td” the Form Button,
registration form is not submitting in spring boot and not hitting endpoints
I’m working on a registration form in Spring Boot and thymeleaf but it’s not submitting to the database. I even run the debugger mood and it did not hit the endpoints for the registration. Note, that my login and other functionalities work fine. I’m following this here to create my registration How to I get this endpoint to create a
How to send the data finded in the controller to a view?
I try to do a java web application using: SpringBoot Mysql JDBC Design pattern: MVC, DAO And Thymeleaf I think i understood than: I must create a class for every Entity and a DAO classe who use the annotation @Repository: Diabetic.java(Entity): DiabeticDAO.java: And create a controller like this where I use the method from the DAO: What i don’t understand:
post method not supported in patch method
I want edit entity with validating by hibernate-validator, but when calling the patch method, an error is thrown: post method not supported. How to make @PatchMapping work correctly? I am a beginner developer, help me please. Controller: Service: Repository: html form: Answer you can not use ‘PATCH’ for the form method attribute. only ‘GET’ and ‘POST’ methods are allowed(source).