11、12、21、22の位置にあるグリッドレイアウトのgrailsページに4つのグラフを表示する必要があります。各グラフは、次のようなコードで作成されています。
<img src="${createLink(controller:'paretoChart', action:'buildParetoChart11')}"/>
チャート作成アクションのコードは次のとおりです。
def buildParetoChart11 = {
def PlotService p11 = PlotService.getInstance()
def poList = paretoChartService.getParetoidPO()
def listCounter = 0
def idPO = poList[listCounter]
idPO.toString()
def String idPOvalue = idPO
def out = response.outputStream
out = p11.paretoPlot(out, idPOvalue)
response.setContentType("image/jpg")
session["idPOList11"] = poList
}
Java p11.paretoPlot(out、idPOvalue)は、OutputStream内のチャートのBufferedImageを返しますが、これは1つのチャートに対してのみ機能します。他の3つのチャートは、すべての注入アクションが呼び出されるたびに順序が異なります。
PlotServiceは私が書いたものです。この実装では、response.outputStreamとStringidPOvalueから取得したOutputStreamをJavaメソッドに渡します。plotParetoの実装は次のとおりです。
public OutputStream paretoPlot(OutputStream out, String po) throws IOException {
chart = buildParetoChart(po);// here the chart is actually built
bufferedImage = chart.createBufferedImage(350, 275);
ChartUtilities.writeBufferedImageAsJPEG(out, bufferedImage);
}
では、次のアクションを実行する前に、1つのアクションが完了していることを確認する方法はありますか?
前もって感謝します!