Introduction to Servlets and Servlet Containers
@@ -11,10 +11,14 @@ import javax.servlet.http.HttpServletResponse;
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);
}
}
