Questions tagged [thymeleaf]

-1

votes
0

answer
25

Views

Successfully uploaded image not showing upon redirect to same page

I have a web app where I can add a product, which contains some product info and an image. When I edit a product, if I change the image, I redirect back to the same page, however even though the new image is successfully uploaded, it is not showing up (error 404), but I can for example inspect the i...
jukenduit
0

votes
0

answer
17

Views

My angular can't get the value from html page

I have an angular function to call me rest service but it can't get the value from the html file. when i press submit the $scope.productForm is, although i still have value in my html page. Main.js $scope.products = []; $scope.productForm = { ID:1, Name:'', Description:'', URL:'' }; _refreshProductD...
Trung Đặng
1

votes
1

answer
71

Views

Thymeleaf: Only variable expressions returning numbers or booleans are allowed in this context

I have a SpringBoot 2.1.4.RELEASE RESTful Web Service app., using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file. I have this piece of code in one of my templates, ... But I got this error when rendering the template: org.thymeleaf.exceptions.T...
carles xuriguera
0

votes
0

answer
32

Views

Spring boot MVC: RequestMapping isn't recognized in Spring boot 2.1.4

Can someone answer this silly question - How to configure Thymeleaf in Spring boot release 2.1.4? I have declared the right dependencies: org.springframework.boot spring-boot-starter-parent 2.1.4.RELEASE org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-th...
AppleBuckler
1

votes
1

answer
186

Views

org.thymeleaf.exceptions.TemplateProcessingException: Only variable expressions returning numbers or booleans are allowed in this context

I have been using thymeleaf th:onclick attribute to call javascript function with parameters as below th:onclick='|myFunction('${parameter1}')|' But with thymeleaf 3.1.10 this has been removed. and they are suggesting to use th:data attribute. I however found workaround on as below and both of them...
want2learn
1

votes
1

answer
2.1k

Views

How to populate modal window by entity from controller in thymeleaf by ajax query

I want to show a particular user with the help of a materialized modal window by clicking on 'view' button. I'm trying to do this by ajax query to my controller. Also I have an error: There was an unexpected error (type=Internal Server Error, status=500). Exception evaluating SpringEL expression: '...
Vitaly Park
1

votes
1

answer
48

Views

selenium issue: with selecting a value in dropdown using thymeleaf

I am facing an issue selecting a value inside a dropdown during a selenium test. I am getting my values from a properties file using thymeleaf in the following way. When I try to select a value in the dropdown, selenium is not able to do that. Instead of getting the dropdown values from properties...
anand
1

votes
1

answer
181

Views

reload table datatables with fragment

i m trying to reload a fragment by ajax, but when i reload my event select does not work neither the row count, it means the default config is not working as i want: @PostMapping('/admin/add') public String add(@ModelAttribute(name = 'client') Client client,Model model){ client.setPassword('sdfsdf'...
1

votes
1

answer
1.8k

Views

How to display byte array from a model in Thymeleaf

I want to display all my products info, but I have problem with showing a product image. I get my products from DB and then I add them to Model, but don't know why only image don't display. In HTML it looks like this: Product name Product summary Product summary In controller I add all the products...
slovvic
1

votes
1

answer
373

Views

Unwrapping a Kotlin hashmap in Thymeleaf inside of Spring Boot 2

I have a Kotlin function which creates a model with a hashmap as shown below @GetMapping('/') fun index(model: Model): Mono { model.addAttribute('images', imageService.findAllImages()?.flatMap { image -> Mono.just(image) .zipWith(repository.findByImageId(image?.id!!).collectList()) .map({ imageAndCo...
1

votes
1

answer
38

Views

How can I get and post File with thymleaf + Spring boot

How can I set the input file for the edit form with Spring Boot + thymelaf? I try to use the MultpartFile class, but I only can get its values... This is the data transfer class: public class DocumentoCommand { private Long id; private String descricao; private String dataEmissao; private MultipartF...
Erik Hakamada
1

votes
0

answer
150

Views

Cannot call Thymeleaf HTML page from URL

I am new with Thymeleaf. I am using in a Spring Boot Project. I am trying to render my HTML page lists.html but it displays the 'lists' not the page. I have added the dependency on Maven org.springframework.boot spring-boot-starter-thymeleaf But, it doesn't work ...
Judy1989
1

votes
1

answer
461

Views

Thymeleaf checkboxes with objects list from database

I'm struggling with some thymeleaf problem - am trying to create form for editting existing users kept in mysql db. What I'm trying to achieve is checboxes list inside my form where I can see checked roles (according to info from DB), and optionally change them by checking/unchecking other roles. Vi...
deafpunch
1

votes
0

answer
1.2k

Views

How to parse JSON string in Thymeleaf for spring-boot application without using Object Mapper?

I am trying to parse following JSON to display information in table format on the web page as shown in the image below. I have achieved this by converting JSON string to object using ObjectMapper and then adding it to model for web page. I am wondering if there any way to directly parse JSON string...
Dharita Chokshi
1

votes
1

answer
143

Views

Spring Boot + Thymeleaf application - how to make several instances of the model attribute

I have a Spring Boot + Thymeleaf application and the following working code: Controller: @Controller @SessionAttributes( {'myBean'} ) public class MyController() { @ModelAttribute('myBean') public MyBean getMyBean() { return new MyBean(); } // multiple requests with 'myBean' // ... @GetMapping('/...
Anna
0

votes
2

answer
63

Views

Error when running a template that contains a form to create a new entity [closed]

I am trying to display a template that will have a form so that a user can create a new subject. When I try to display the page I am getting the below errors `java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'subject' available as request attribute ` Serv...
Jill
1

votes
0

answer
393

Views

Warn to user with message in session timeout in spring boot app 2.0

I want to display message to user as 'Singed out because of inactive' in login page . I tried the below code in spring security but its not effected . sessionManagement().maximumSessions(1).expiredUrl('/login?expired') in httpsecurity . After session timeout , simple its redirect to the /login only...
Pyla Srenu
1

votes
1

answer
579

Views

What is the right way to handle redirect in Spring Boot?

After research on subjects concerning differences between spring boot and previous spring mvc frameworks. I am confused and need some help! How to do redirect to an html page since normally trying to redirect without the page target having a controller method returns HTTP 404. if I have this contro...
msf6012
1

votes
0

answer
156

Views

Using thymeleaf and bootstrap to create a panel accordion from a list but collapsable function doesn't work

I am very new to bootstrap. I am using bootstrap along with thymeleaf to create a collapsable panel accordion from a list. Iterating through the list works. Displaying the panel body works. At one point I was able to get the collapse function to work after iterating through the list, but that would...
Tan W
1

votes
0

answer
721

Views

Send form in JSON using Thymeleaf and Spring boot

I'm using a form using Thymeleaf to send data to my Service. Here is my Form: FirstName: LastName: Address: Submit When I debug the request sent using this form it gives me this data : individualName.givenName=xxxx&individualName.surname=xxxxx&address=xxxx However I want that it will be in JSON when...
taboubim
1

votes
0

answer
212

Views

Thymeleaf/Spring Boot: “th:onclick” method being called on every refresh

In a table in my Spring Boot project, I have a button being created for each object of type Task that triggers the task. Due to the nature of how I wrote it, it seems to be calling the method every single time I refresh the page: Trigger Obviously I've written it incorrectly, and I can kind of see w...
realmature
1

votes
0

answer
174

Views

Sping Boot Application Deployment issue on Weblogic

I have a Spring boot application that uses Thymeleaf as a template engine, I added a default controller that should redirects to Home page when deploying on server, Controller code snippet below: @Controller public class HomeController { @RequestMapping('/') public String index() { return 'index'; }...
Heythem
1

votes
0

answer
274

Views

SpringBoot + Thymeleaf + Bootstrap Carousel not rotating between pictures nor carousel controls working

I have a SpringBoot + Thymeleaf + Bootstrap web application and I have a Bootstrap Carousel on the main page. The carousel works fine when I load it statically but when I have it running in the SpringBoot/Thymeleaf environment it doesn't rotate between the images nor do the left/right controls work....
matt_delicioso
1

votes
0

answer
339

Views

Thymeleaf + AngularJS - Spring Boot Application

reading many articles about Spring boot Application, use of Thymeleaf (Server side presentation) and Angular 1 (Client side) i have found different opinions. My question is: Can I 'mix' use of Thymeleaf and Angular? Not if it is possible, becauase it is, i want know if is correct and I can have adva...
Daniele Buratti
1

votes
1

answer
822

Views

Thymeleaf - delete with confirme modal

I want to delete the object from table. The problem is that I do not delete the object I click. I always delete the object above. what am I doing wrong? home.html V E Are you sure? × Close Yes Controller @GetMapping('/home/{fingerprintId}/deleteFingerprints') public String deleteFingerprints(@Path...
Alexandra
1

votes
0

answer
277

Views

Like/Dislike function with Spring Boot and Thymeleaf

I have a table in my Thymeleaf template which shows database data. I have additional two columns which contain Like and Dislike buttons for each row. I want to enable liking/disliking 'posts'. My idea was to simply increment Like/Dislike count in a database by updating database entity. So, in my tem...
Marina_Radiskovic
1

votes
1

answer
721

Views

Why can't I send model? Spring Boot 2 - Thymealf

I can not open the registration page. If I delete the th:field page is displayed. How can I solve problem. I can not speak English well Thank you... Error Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Thu Mar 01 01:10:34 EET 2018 Th...
DnzDmr
1

votes
0

answer
125

Views

I am developing bookstore in spring boot app when i run my application it shows http status 404 found and it shows following exception i

it is not working as expects i have configured correct properties in application.properties file server.port: 8041 server.contextPath: /BookStore spring.thymeleaf.cache=true spring.boot.static-path-pattern=/resources/static/** spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.h...
Vinoth
1

votes
1

answer
41

Views

Radio button Label Change

I need to change the radio button label from actual value to another value below is my model attribute @ModelAttribute('type') public ArrayList getType(){ ArrayList type = new ArrayList(); type.add(1); type.add(5); return type; } but when I need to show it I need it to be for 1 as 'single' for 5 a...
user2567005
1

votes
1

answer
146

Views

I study thymeleaf but i don't know what does it mean this th:field from this <select>

I try to do a dropdown list with some files and I find this example and I don't know what it should contain the th:field. Please can you tell me also what it should contain the post method in spring if I what to have the selected value? Please help me!! :) Wireframe
Alexandra
1

votes
0

answer
195

Views

Thymeleaf creating and sending multipart form object by itself to controller even though user is not selecting any file

I'm trying to upload a Multipart file using Thymeleaf and spring boot, but even though I am not selecting any file to upload after clicking on Submit button Thymeleaf is creating and sending the Object to controller by itself. Upload Image: Android: Cancel My Controller Code is Here - @RequestMappin...
Sumit
1

votes
0

answer
33

Views

How to call a thymeleaf modal fragment from a javascript generated link?

I have a javascript function that renders a table from an ajax call. The row rendering bit is: function buildTable(id) { trHTML = null; $.ajax({ type: 'GET', url: siteroot + 'apiURL' + id, data: {}, dataType: 'json', cache: false, success: function (data) { for (i = 0; i < data.length; i++) { trHTML...
gtludwig
1

votes
1

answer
103

Views

th:each loop doesnt work

I have problem with th:each. It doesn't looping. I try fix it for long time and I searched many topic with the same problem but it still doesn't work. So I ask here for info how fix it. Nothing display from the list (First and Second) on webpage so i think that with this is something wrong Book c...
quefie
1

votes
0

answer
126

Views

Spring Thymeleaf - How to edit(update) a user selected entity(object) via Thymeleaf form?

In my application the user is show a list of exam objects and they select one to edit. When they click the edit link it brings them to a HTML page where the URL contains that exams ID. I would like to know how to pass the id of the exam to the controller. I'm getting this error: 'Missing URI temp...
Jill
1

votes
0

answer
61

Views

Updating web UI from Spring

I'm using Spring Boot and Thymeleaf and I'm a bit confused about finding best solution. On back-end side, I got sheduled function that is sheduled several times a day, and each time it updates my Boolean success; flag to true if everything went fine, or false otherwise. So lets begin with Controlle...
user9309329
1

votes
1

answer
217

Views

How can I add CSRF token to upload file using HTML 5 (data-) inside an input?

I'm using this bootstrap-fileinput plugin to upload file in my WebApp. To develop this WebApp I'm using: Bootstrap4, Thymeleaf and Spring Boot. I would like to use the html5 convenction to use that plugin, so this is the code: But I enabled the CSRF protection with Spring Security. So when I try t...
PaolaG
1

votes
1

answer
39

Views

How to retrieve data from array using $.getJSON?

I have a small web app where I need to populate a dropdown list after selecting another right before. For example this is the URL of the Ajax request http://localhost:8080/ajax/dropdown_model?brandId=0 and the JSON code looks like this: [{'id':0,'name':'Z-400','brand':{'id':0,'name':'Lenovo'}}] The...
ffuentes
1

votes
1

answer
345

Views

javascript variable in location.href

In javascript I have this variable: var selectedItemId = null; // the actual value is set from another function Then I have this function: function editLink() { location.href = /*[[@{/supplycontracts/edit/}]]*/''; } Now I want to add the variable to the href, so that in the end it looks like this:...
hooch
1

votes
0

answer
121

Views

Thymeleaf - get dom element attributes

I create html components with Thymeleaf. Components are declared in separate file: Declaration of basic button in buttons.html Button The idea is to provide some type of tool-set for components. Code for using this component will be: It's working well, but I think about case when button need to have...
zur4ik
1

votes
1

answer
85

Views

Thymeleaf select sets null

I'm trying to set the ingredient's unit of measure, but it sets their ID's to null. The object I send is a wrapper that contains IngredientsCommand objects. Test > @Getter @Setter @NoArgsConstructor public class IngredientsCommand { private Long Id; private String ingredientName; private Long recip...
Vio Ariton

View additional questions