This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have an html.file with a <form action="doAction">-tag that forwards to a servlet. This servlet creates a "chart.png"-file and then forwards the request and the response to the view (result.jsp). Sadly the view cant use the previously created chart.png at compilation time, since it takes its time to write the file. So the result shows only a missing img-frame. After a few seconds or so the chart.png-file appears in Netbeans under the Folder specified. Of course the second attempt does display a chart.png, but i need it at request time. Haha! That was funny!
I need the chart to be fully written, when the result.jsp <img src="FOLDERS/chart.png"> builds the html output.
What can i do?
I will try to stuff the code that creates the chart.png-file into a thread within the servlet. I dont like this workaround, it causes a delay, which i dont want! Hints please.
The problem remains even with a Thread.sleep(30000);, the problem is the Netbeans IDE, which does the refresh of the pic-containing folder. The refresh does happen when the user maximizes the IDE.