简体   繁体   English

是否有任何方法可以将文件添加到tomcat服务器上已部署的Web应用程序

[英]IS there any way to add files to a deployed web application on tomcat server

我正在使用jsf2 Web应用程序,需要将文件上传到Webcontent的文件夹中并永久保存,我使用了JSF FileUpload Directory中提到的技术,可以将其上传到wtp ...文件夹的子文件夹,但是正如BlueC所说的,当tomcat重新启动时它迷路了,有什么办法吗?

You can store the files in a Database using a BLOB field. 您可以使用BLOB字段将文件存储在数据库中。 It will depends of how you are implementing the persistence layer of your application but in the Java side usually you will implement this field as byte[]. 这将取决于您如何实现应用程序的持久层,但是在Java端,通常将此字段实现为byte []。 So it will be comfortable for download or display the file. 因此,可以轻松下载或显示文件。

您可以将文件上传到某个目录/默认目录,然后手动将文件复制到部署目录和应用程序服务器安装之外的安全文件夹中(是的,您可以这样做)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否有可能在不终止现有Web服务的情况下向Tomcat上部署的Web服务添加模块 - Is there any possibility to add a module to a web service deployed on Tomcat without terminating the existing web service Tomcat上部署的Web应用程序中的NoClassDefFound错误 - NoClassDefFound error in web application deployed on Tomcat tomcat部署的Web应用程序的上下文路径 - Context path for tomcat deployed web application 使用部署在其中的Web应用程序关闭tomcat - Shutdown tomcat using web application deployed in it 第一次访问时,部署在tomcat上的Web应用程序运行缓慢吗? - Web application deployed on tomcat is slow on first access? Tomcat Web应用程序管理器未列出已部署的应用程序 - Tomcat Web Application Manager Not Listing Deployed App Tomcat Web应用程序可与其他外部部署的tomcat Web应用程序进行通信 - Tomcat web application to communicate with other external deployed tomcat web applications 文件未从Apache Web服务器传输到Tomcat应用程序服务器 - Files not getting transferred from Apache web server to Tomcat application server 在Web应用程序中获取tomcat / glassfish使用的Java路径的任何方法 - Any way to get java path used by tomcat/glassfish in web application 如何在tomcat服务器中获取所有已部署的应用程序 - How to get all deployed application in tomcat server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM