简体   繁体   English

PlayFramework 2.X路由到生成的内容

[英]PlayFramework 2.X routing to generated content

I have a process within my play app that generates a text file. 我的播放应用程序中有一个生成文本文件的进程。 I would like to copy this text file to a directory where i can then view it from a static route. 我想将此文本文件复制到目录中,然后可以从静态目录中查看它。 In production mode, the public assets folder is jar'd up, Is there a directory I can place my files into where I can route to them in prod mode. 在生产模式下,公共资产文件夹被挂起,是否存在目录,我可以将文件放置在该目录下,以生产模式路由到它们。

Thanks for confirming mz, I ended up rolling my own solution which is hopefully secure.... In my Global application class , I store a file location, which is then accessible by my controllers. 感谢您确认mz,我最终推出了自己的解决方案,希望该解决方案是安全的。...在我的Global应用程序类中,我存储了一个文件位置,然后可由控制器访问。 The controllers simply read the file(s) into a Buffered REader, then spit them back out. 控制器只需将文件读入Buffered REader,然后将其吐回去即可。 using OK.sendFile(string). 使用OK.sendFile(string)。

thanks , 谢谢 ,

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

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