All Questions
17 questions
0
votes
2
answers
838
views
Thymeleaf Spring JPA One to Many type mismatch
I have a Spring Jpa project with a One to Many relationship.
The error when submitting form is:
Field error in object 'product' on field 'category': rejected value [2]; codes [typeMismatch.product....
0
votes
2
answers
406
views
How i get value category and categories product in another class with using @ManyToMany
I have 3 class.
Product Class
package com.eziz.warehouse;
import com.eziz.clients.Clients;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
@Entity
@Table(...
0
votes
1
answer
43
views
My values in spring boot table row is getting erased
I am making a medicine application where I am adding medicine id, medicine name, and more. Here I have a column called Medicine Quantity which shows how much of which medicine is left in my stock and ...
0
votes
0
answers
241
views
Source cannot not be null on thymeleaf page
I have an exception (cannot be null)that is thrown when I fill in the email field of my form. It happens when I submit my form.
I join the controller, model, service, and dto classes.
Controller ...
0
votes
1
answer
188
views
template might not exist or might not be accessible by any of the configured Template Resolvers after deploy
For some reason, after the deployment, I started to give a 500 error when saving (that is, the post fulfills the request, but reloading the same page already by get causes an error. And the first time ...
1
vote
1
answer
888
views
Even if the form fields are left blank, empty strings are submitted and new entity is created in Spring
I have two entities: Student and StudentDetails. A Student can have only one or no StudentDetails. When I submit a form to save a Student, a StudentDetails is also being saved. That's okay if I send ...
1
vote
1
answer
153
views
What is the proper way to handle a delete request in a controller?
Trying to make a delete http request from Thymeleaf template file
From template:
<tr th:each="ingredient : ${listIngredients}">
<td th:text="${ingredient.id}">...
0
votes
0
answers
33
views
OneToMany entity parent field giving null after being set by parent
I'm trying to submit a form with Quiz as form backing entity and some Question inside of it.
These two entities are related in a bidirectional association:
@Getter
@Setter
@ToString(exclude = { "...
0
votes
0
answers
66
views
Problem with regenerating Id during entity edit via Thymeleaf
I am using SpringBoot 2.1.2 with Hibernate and Thymeleaf.
When user is editing entry (object Person) the new Id generates. Therefore instead of changing the state of the object, a new object is ...
0
votes
1
answer
681
views
How to post a List of Entity type data using Thymeleaf?
My project based on spring boot,Thymeleaf,mysql,html and Jquery.
Scenario
My scenario is POST a List of EntSetCharges Data using Thyemeleaf and hitting the Spring boot @RestController.
Previously i ...
3
votes
2
answers
25k
views
java.lang.IllegalStateException: No primary constructor found for java.util.List
My project based on spring boot,Thymeleaf,mysql,html and Jquery.
I tried to post a List of EntSetCharges type data to the @controller ,but it is not succeed..it trows error like
java.lang....
2
votes
2
answers
12k
views
org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'chargesName' cannot be found on null
My project based on spring boot,Thymeleaf,mysql,html and Jquery.
My scenario
is to Get the List iterate and show the data in the table 1st column in the HTML and post the data (html-chargesName and ...
0
votes
2
answers
6k
views
Thymeleaf: Display data from two JPA entity tables on same page
I am using Spring Boot, Thymeleaf, Hibernate and JPA to develop this application. I have mapped a relationship between the two entities I need to retrieve data from and am wondering how to display ...
1
vote
1
answer
2k
views
Display an image with spring boot hibernate and JPA
When I try to add an image in Base64 from a Product Object, like next:
<tbody>
<tr th:each="product : ${products}">
<td><img th:src="@{'data:image/png;base64,' + ...
1
vote
1
answer
2k
views
Spring Boot Post Request Method not having all Object values
Using Spring Boot, Hibernate JPA and Thymeleaf.
I have an Order database table which currently only holds 1 record. This record has a few columns and some of the columns are not seen on any forms, ...
0
votes
1
answer
2k
views
Spring Data Thymeleaf-cannot insert related record, foreign key null
I have 2 entities with one to many relationship. Related child entry fails to insert because foreign key is null. Works in Tests though.
Looked high and low, most were resolved because questioner ...
0
votes
1
answer
2k
views
Spring Data Jpa MVC - data not inserting, but persists during Test
My problem is quite the other way round, most questions here are for test data not being inserted, mine persists in tests but not when called thru the controller.
I'm still new at this so may have ...