Reputation: 1820
I have an xml document that I used JAXB to ultimately have struts2 display in a webpage.
This document at a high level contains CDATA sections that are paragraphs that contain some HTML. The java object returned is a list of the paragraph objects whose text gets turned into strings.
When I display them in the JSP I get the paragraphs outputted to the screen and they contain HTML but it is not rendered.
I have found answers on here about removing HTML from java strings but nothing like this. I also don't have control over the XML document I only consume it.
Upvotes: 3
Views: 2479
Reputation: 149037
EclipseLink JAXB (MOXy) has the @XmlCDATA annotation for handling CDATA (I'm the tech lead). This may help if you can use MOXy as your JAXB implementation.
For more information see:
Upvotes: 2