I'm writing a Struts action class from which I generate some HTML content and add it to a field in ActionForm. How can I display it in the JSP file.
I would consider to use the request object instead of modifying the ActionForm. You may use the logic and bean taglibs in the JSP and try to separate the HTML content and put it all in the JSP.
As example, you can use in your action:
request.setAttribute("message", "<STRONG>html message</STRONG>");
And in your JSP something like this:
<logic:present name="message">
<bean:write name="message" filter="false" />
</logic:present>
But I think it would be a better aproach to leave of the html code to the JSP who is the responsible of that. An action has to do other things and is a good design to maintain these tasks separate.
Consider this for your action:
request.setAttribute("message", "html message");
And this for your JSP:
<logic:present name="message">
<STRONG><bean:write name="message" /></STRONG>
</logic:present>
This way you centralize all the html code generation on your JSP files and free the action of that burden.