I'm learning to use Spring Boot
and I need to create a field in the form that loads the image to be used. How do I map the directory and save to a particular project folder?
Example: Through the form, the user will load the photo. Instead of saving the image to the database, how do I save only the directory that will load the image into view
? Adding, and if possible, how to load this image by the control class?
Please, Before leaving negative for my question , I saw some answers, so far in stackoverflow
, but I still have doubts about how to proceed within the domain classes. Domain class example:
Note: I'm using MySQL
.
package com.ptestes.models;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class HotSite implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
private String pageTitle;
@?????
private <?????> img;
/*Getters and Setters*/
}
Thank you in advance! ^ _ ^