As I integrate jci into Struts Ti, I'm faced with how to display the compilation errors to the user.
Oh, integrated with Struts ...cool :)
What general strategy does Cocoon or any other web framework use to do this?
Well, TBH I am currently looking into that myself. The idea is to keep the result of the last compilation until there is a reload. If there is an error present it.
The asynchronous nature of the compiler makes it difficult to display the errors to the user the next time the refresh their browser.
Shouldn't the above strategy work for you as well?
Do you just assume they will be tailing the logs?
Hehe ...of course not!
Is there any way to manually control the file monitor check so, for example, a refresh of the browser would trigger the check and compilation so the errors could simply be displayed on the page returned to the browser?
Well ...actually this *could* be added. A page hit could interrupt the sleep of the monitor and trigger the scan. ...but believe me - you don't want that. For sure not in production. Your monitor would constantly run!
This question is in addition to the current discussion of how to work the CompilationProblemHandler. FWIW, I just added a clear() method to the interface, called if any errors or warnings are found and processed, but I'm open to any solution.
Yes, that was also my first idea cheers -- Torsten
PGP.sig
Description: This is a digitally signed message part