There is a properly formatted text in Html textarea which looks like :

As this song/poem is submitted a servlet handles it and and puts it all in the string and saves it in the servlet context.At one point I have to display the poem submitted but when I get that attribute from the servlet context it displays the text in one single line.
What should I do to save the text as String in the servlet context that is formatted in the same manner as has been formatted in the text area.
servlet snippet that handles the poem :
String poetry = request.getParameter("poetry");
String poet = request.getParameter("poet");
ServletContext context = getServletContext();
poetryMapsPoet = (HashMap<String,String>)context.getAttribute("Poetry");
if(poetryMapsPoet == null) {
poetryMapsPoet = new HashMap<String,String>();
context.setAttribute("Poetry", poetryMapsPoet);
}
poetryMapsPoet.put(poetry, poet);
// Poetry is the key and poet is the value
Wrap it in a pre block:
Or use a tag that will transform every end of line into a
<br/>. I’ve always wondered why this wasn’t part of the JSTL. But it’s pretty easy to write yourself.