简体   繁体   中英

Vaadin Image Upload Path

How can i save my uploaded image to "src" folder not in "target" folder. i just noticed that both folders have the same directory. this is my code.

URL url = this.getClass().getResource("/com/sample/global/imgfile/");

Everytime i uploaded the image the path is saving in this directory.

this is the directory that where the uploaded image will go.

\\target\\payroll\\WEB-INF\\classes\\com\\sample\\global\\imgfile

but i want the image to go to this directory instead

\\src\\main\\resources\\com\\sample\\global\\imgfile

Thank You.

You can't. You have to be aware that when you run your application the "src" folder will no longer exists. All resources of your "/scr/main/resources" will be copied to "WEB-INF/classes/

Remember that you're deploying the application to a target server (any application server like tomcat, jetty, etc)

So, if you'd like to have some kind of "resources" folder, just create another folder with that name under the resources folder, lets say "/src/main/resources/resources". That way when you deploy the application you'll have the following structure "/WEB-INF/classes/resources".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM