BAEL-4691: Introduction to Servlets and Servlet Containers (#10281)
This commit is contained in:
parent
29cca467c4
commit
b67a3eab35
|
@ -10,11 +10,15 @@ import javax.servlet.http.HttpServletResponse;
|
|||
@WebServlet(name = "ExampleThree", description = "JSP Servlet With Annotations", urlPatterns = { "/ExampleThree" })
|
||||
public class ExampleThree extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String instanceMessage;
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
String message = request.getParameter("message");
|
||||
instanceMessage = request.getParameter("message");
|
||||
request.setAttribute("text", message);
|
||||
request.setAttribute("unsafeText", instanceMessage);
|
||||
request.getRequestDispatcher("/jsp/ExampleThree.jsp").forward(request, response);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue