Show image with variable name Thymeleaf Spring Boot

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 17

  • @ramkrishnamaity2933
    @ramkrishnamaity2933 5 ปีที่แล้ว

    how to show image from outside of project folder.please help

    • @discospiff
      @discospiff  5 ปีที่แล้ว

      In src, did you try a fully qualified path ()?

  • @meherremmemmedov4721
    @meherremmemmedov4721 5 ปีที่แล้ว +1

    Hello, thaks for tutorial. But my images not show dynamicly added /static/photos/ directory.But restart application later show in thymeleaf pages.
    How to repair this problem ? Please help me.

    • @jonatasalmeida4196
      @jonatasalmeida4196 4 ปีที่แล้ว

      same here

    • @puspendertanwar9378
      @puspendertanwar9378 4 ปีที่แล้ว

      make thymeleaf cache=false and rebuild the file using ctlr+f9

    • @dunareanu4795
      @dunareanu4795 3 ปีที่แล้ว +3

      for whoever is reading in the fututre: add in application.properties these two lines
      spring.web.resources.static-locations[0]=file:src/main/resources/static/
      spring.web.resources.static-locations[1]=classpath:/static/
      found on SO and this solved the problem for me, dont have to refresh project to see the images

    • @fernandorios3962
      @fernandorios3962 3 ปีที่แล้ว

      @@dunareanu4795 Thanks a lot, it really works

  • @matheusma37
    @matheusma37 5 ปีที่แล้ว

    Thank you, your video helped me a lot, good work.

    • @discospiff
      @discospiff  5 ปีที่แล้ว

      Excellent. Thanks for the feedback!

  • @xyonzx4094
    @xyonzx4094 4 ปีที่แล้ว +1

    you access the image inside the project ! the previous video you upload image in the disk not the project, now you show this? why?
    the question is how can i show the image that i upload to the disk not inside the spring Project

  • @eldersonlaborit2290
    @eldersonlaborit2290 4 ปีที่แล้ว

    hello good afternoon, a question, i am starting with spring mvc and thymeleaf.
    I am trying to show some images obtained from the api: pokeapi.co/api/v2/pokemon/1
    and I want to get the images found inside sprites.front_default
    I have the information obtained from the response, when I do a console.log it shows me the information but when I render it in the view it throws an error, to render I use: th: text, to iterate I use td: each.
    From already thank you very much.

    • @discospiff
      @discospiff  4 ปีที่แล้ว

      What is the error message?

    • @eldersonlaborit2290
      @eldersonlaborit2290 4 ปีที่แล้ว

      @@discospiff There was an unexpected error (type=Internal Server Error, status=500).
      An error happened during template parsing (template: "class path resource [templates/PokedexView.html]")
      org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/PokedexView.html]")
      at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241)

  • @thurathant5262
    @thurathant5262 5 ปีที่แล้ว +1

    Thank you so much ,....

    • @discospiff
      @discospiff  5 ปีที่แล้ว +1

      You're welcome. Thanks for watching!

  • @giorgioquaresima6795
    @giorgioquaresima6795 5 ปีที่แล้ว

    hello thank you for your video tutorial. i'm learning java. i don't understand how i can read a blob file in a table in html file. in mysql i have a Blob column. in pojo i have byte[ ] . i'm using spring boot and hibernate with annotation. i set all the configuration in the application.properties file and i'm implementing crud method with JpaRepository . if i use save() method of JpaRepository i don't have any problem to insert row in a database by a form. but if i use the findAll() method i read all the row of the columnes in the html file except the value of the Blob column (byte[] in the pojo) i'm not using entitymanager and resultset beacuause i don't need with annotation and application.properties. i'm sorry for my english. thank you ser.

  • @eamonmac2751
    @eamonmac2751 5 ปีที่แล้ว

    How would you do this for an image gallery? Instead of displaying one image display them all. Thanks