Preface to the is problem: I am coding in a framework that blends jsp
and xml in a heathen manner. Meaning I have to nearly sacrifice a
virgin to get anything to work.
I want to load the character '<' into a java string. Only problem is
that that string is inside a bit of XML. And to compound the problem
the string is sent to a browser as part of an html page. The line
something looks like: (with a '_' in where the '<' needs be)
out.print("_title>Hello, World_/title>");
We were aiming to have the title of the page be "Hello, World". The
problem is that if the blank is filled with '<' the servlet fails to
compile because there is an XML error and nothing is output where this
should be in the html source. If the blank is filled with "<f;" then
java interprets this as 5 characters. This outputs to the screen the
phrase:
<title>Hello, World</title>
and the source of the html page looks exactly like the Java string:
<f;title>Hello, World<f;/title>
Any idea how to get a '<' into a java string inside XML?
(The solution that I am using involved virgin sacrifice, we used some
custom tags from the framework. Somthing along the lines of <c:title
value="Hello, World"> )