File upload using RichFaces

后端 未结 2 925
梦谈多话
梦谈多话 2021-02-06 05:28

I am currently looking in to some file uploading using Java Server Faces. I\'ve found this great introduction to it using RichFaces. However, I have some troubles understanding

2条回答
  •  梦如初夏
    2021-02-06 06:16

    Writing things to your WAR directory (assuming the WAR is even exploded as a directory) is, in generally, a bad idea (for the same reasons that storing your data in your application directory is usually a bad idea).

    You'd probably want it to end up in a persistence store, usually a database. Exactly how you manage that is up to you - whether you use the file system and store a reference in the database or store a BLOB in the database directly and whether you use JDBC or JPA or Hibernate, etc.

    The list of uploaded files could then be read from the database by refreshing the panel that contained them using something like .

    A file download servlet (if RichFaces doesn't have one) is fairly easy to write.

提交回复
热议问题