コマンドオブジェクト内のバイト[]にイメージを保存し、それをcreateFlow Webflowの次の段階に表示したいとします。Grails Webflow display image-flow scope
私は、Webflow中に画像を保存するためにファイルシステムやデータベースシステムを使用することを明確にしています。
典型的には、画像を表示するために、私は、GSPからrenderImageを呼び出すであろう:
class ArtefactController {
def createFlow = {
............
}
def renderImage = {
def ArtefactInstance = Artefact.findById(params.id)
if(ArtefactInstance?.image) {
response.setContentLength(ArtefactInstance.image.length)
response.outputStream.write(ArtefactInstance.image)
}
else {
response.sendError(404)
}
}
を但しWebflowのための私はGSPからrenderFlowImageをコールしようとする:
def renderFlowImage = {
if(flow.artefactCommand?.image) {
response.setContentLength(flow.artefactCommand.image.length)
response.outputStream.write(flow.artefactCommand.image)
}
else {
response.sendError(404)
}
}
流量範囲アクセスできない
提案がありますか?
回答ありがとうございます。 flowExecutionKeyの回避策についてどうご存知ですか? – user898100
回避策としては、次の記事(http://bit.ly/8NnO8vおよびhttp://bit.ly/9ApKP7)に記載されている手法を適用できると思っていました。しかし、私は個人的には、画像のレンダリングに専念するステップで自分の流れを汚染したくないでしょう。また、 "Ajaxflow"プラグインを見ることもできます。 –