Render html-string / jsp tags

G

GuyBrush Treepwood

I'm using struts to program a web-based bookmark manager. Instead of going
to the real page, a user can decide to view a cached version of it. This
cached version is a blob in the database. The action for rendering the
cached version, makes this blob available as a string (the complete html
code this is).

I'm now wondering how to render this string in a jsp page using the tag
library struts-el and jstl.
A <c:import> needs an url, and a <c:eek:ut> renders the string as text.
 
W

Wendy Smoak

GuyBrush Treepwood said:
I'm using struts to program a web-based bookmark manager. Instead of going
to the real page, a user can decide to view a cached version of it. This
cached version is a blob in the database. The action for rendering the
cached version, makes this blob available as a string (the complete html
code this is).

I'm now wondering how to render this string in a jsp page using the tag
library struts-el and jstl.
A <c:import> needs an url, and a <c:eek:ut> renders the string as text.

I wouldn't use a JSP for this. From a Struts Action, you can take over the
response, write out the text you've retrieved from the database and return
null from the 'execute' [or equivalent] method to tell the framework there
is nothing further to do.

But I would actually do this in a Servlet, not an Action. To render .csv
and .pdf files in my project, I put a key in session scope then redirect to
the PdfServlet which retrieves the file and sends it to the browser.

How are you going to handle images? (Or maybe the pages are plain text...)
 
G

GuyBrush Treepwood

GuyBrush Treepwood said:
I'm using struts to program a web-based bookmark manager. Instead of going
to the real page, a user can decide to view a cached version of it. This
cached version is a blob in the database. The action for rendering the
cached version, makes this blob available as a string (the complete html
code this is).

I'm now wondering how to render this string in a jsp page using the tag
library struts-el and jstl.
A <c:import> needs an url, and a <c:eek:ut> renders the string as text.

I wouldn't use a JSP for this. From a Struts Action, you can take over the
response, write out the text you've retrieved from the database and return
null from the 'execute' [or equivalent] method to tell the framework there
is nothing further to do.

But I would actually do this in a Servlet, not an Action. To render .csv
and .pdf files in my project, I put a key in session scope then redirect to
the PdfServlet which retrieves the file and sends it to the browser.

How are you going to handle images? (Or maybe the pages are plain text...)

I see what you mean. Can you point me to some examples in this direction?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top