6
What is the best strategy for uploading and using JSF images?
I don’t want to use the field blob in the database, then how do I resolve the problem of the images storage folder, since the file . War is closed.
6
What is the best strategy for uploading and using JSF images?
I don’t want to use the field blob in the database, then how do I resolve the problem of the images storage folder, since the file . War is closed.
4
There are two commonly used upload file saving approaches: saving to DB or to a folder off-project
It is very common to see, who is starting to work with java web projects, the upload being saved in the same project directory. In other words it is common for people to save the files inside the same folder where the deploy was made, in the case of Tomcat, it would be inside the webapps folder.
'Cause that’s bad practice?
Who takes care of the folders created inside a server, is himself. It may well delete, rewrite, copy or do whatever you like with the files found there.
In this case the correct one would be to have a folder outside the server’s deploy area for example. Something like: "C: uploads"
The advantage of this approach is that when backing up the database, the image is automatically being backed up. Another advantage is the fact that the code becomes simpler, to search for an image just a simple query.
The disadvantages would be that:
The advantages of saving files to a folder would be:
In the case of JSF you will run into the problem that the components natively only display images that are inside the server (at least those I know of, others may already have the function of searching outside the server).
There are solutions you could make to display the images:
Very enlightening your reply! Thank you. Remember the name of the component primefaces? The images would be dynamic..
It would be the Dynamic image (I think that’s how you write).
Thanks! was of great help
Browser other questions tagged java jsf
You are not signed in. Login or sign up in order to post.
You know about where to write or how to use JSF to upload?
– Alexandre Marcondes