I have webmvc application with jsp-page as a view.
Here one of my mapping methods:
@RequestMapping("vacancy/{id}")
public String showVacancy(@PathVariable String id, Model model) {
Vacancy vacancy = vacancyRepository.findOne(new ObjectId(id));
model.addAttribute("description", vacancy.getDescription());
return "vacancy";
}
Here the part of vacancy.jsp:
<body>
<h1><c:out value="${title}"/></h1>
<hr>
<h2>Description</h2>
<c:out value="${description}"/>
</body>
As you can see, I trying to send description to jsp-attribute ${description}.
The problem here is in that description. It has html-tags. For example
<p><strong>Responsibilities:</strong></p>
And after rendering I get quite strange html page that includes that description with all tags :(
How can I fix it?