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.
Originally posted by Alan Parson: (don't ask why it is this way)
OK, I won't ask -- and I'll assume you're not in a position to rethink that -- but such an egregious violation of the separation of concerns makes my teeth hurt.
I need to load that fragment at runtime and render it.
As you have seen, merely blatting it out to the JSP at run time isn't going to work. JSP is parsed and evaluated at translation time and converted to servlet code. By the time the JSP is executed, the time for translation is long past.
Is this even possible?
Nothing I can think of off the top of my head is going to allow you to trigger a translation on a string in memory -- but that's certainly nothing that I've given any previous thought to.
The only thing that occurs to me that could work is to write the fragment out to a temporary JSP file, and then use a request dispatcher to include the on-disk fragment. [ February 20, 2006: Message edited by: Bear Bibeault ]