我想将图像上传到服务器,将其存储在文件系统(外部服务器)中,然后将其显示在我的JSF页面上.
我想找到这样的东西:
<?xml version="1.0" encoding="UTF-8"?> <Context allowLinking="true" cookies="true" crossContext="true" override="true"> <Resources allowLinking="true" className="com.triplemind.site.engine.SourceResolverContext" homeDir="/home/myapp/files" /> </Context>
我找到了一些解决方案,但是我想知道是否有更好的方式来做到这一点.
> Configure static resources in JBOSS AS 7(未回答)
> Replacement for context.xml in AS7? Access files outside the
WAR?(未回答)
有我发现的jBoss文档:
> The static-resources element
> AdminGuide Container Configuration
任何帮助将不胜感激.提前致谢
解决方法
最后,我决定使用BalusC(
link)实现的FileServlet.这个解决方案现在适合我.我只将其basePath更改为服务器上的某些路径.