File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rendering JSP loaded from the database.

 
Alan Parson
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP (consisting of custom tags) stored as a CLOB in the database. (don't ask why it is this way). I need to load that fragment
at runtime and render it.

Basically I need the equivalent of an "eval" operation that is present in
Javascript but it applies to JSPs..

I have noticed that it does not work (using Resin 3.0+). Is this even
possible?

[ February 20, 2006: Message edited by: Alan Parson ]
[ February 20, 2006: Message edited by: Alan Parson ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic