I’d like to response to a url request with a hardcoded but dynamic html response.
Are there better ways than doing following way?
public void doGet(HttpServletRequest request,
HttpServletResponse response)
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Hola</title>");
//
}
?
One way is just to forward the response in your servlet: