Answer the question
In order to leave comments, you need to log in
How to infer class method in JSP from servlet?
How would it be correct to indicate in
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);
}
}
<html>
<body>
<p>${-------}</p>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question