Hi @all,
I want to use a the Apache Tiles 2 TagLib in an servlet. I mean the page which is generated uses some Tiles 2 Tags, and therefor I have to use this taglib. But how can I get this taglib in my servlet.
|
Code:
|
public class ProjectDetails extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
//out.println("<%@ taglib uri=\"http://tiles.apache.org/tags-tiles\" prefix=\"tiles\" %>;");
out.println("<html>" +
"<head>" +
"<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\">" +
"<link href=\"css/layout.css\" type=\"text/css\" rel=\"stylesheet\">" +
" <title>AIS DCL</title>" +
"</head>" +
"<body>" +
"<tiles:insertDefinition name=\"aisdcl.projectAdminView\" />" +
"</body>" +
"</html>");
} finally {
out.close();
}
} |
This line out.println("<%@ taglib uri=\"http://tiles.apache.org/tags-tiles\" prefix=\"tiles\" %>;"); will not work, because the writer writes it in html and it will not get compiled or whatever. But how can I use this taglib in my servlet????