Как будет верно указать в
request.setAttribute
public class Servlet extends HttpServlet {
public class PrintText {
public void printText() throws Exception {
System.out.println("Hello!");
}
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintText p = new PrintText();
p.printText();
request.setAttribute(--------);
request.getRequestDispatcher("/WEB-INF/index.jsp").forward(request, response);
}
}
в JSP ${}:
<html>
<body>
<p>${-------}</p>
</body>
</html>