* JSP Servlets With Three Examples JSP Article! * Readme BAEL-426 - still needs permanent URL * Cleanup * BAEL-426 - Final spot for working code Tested. It's all good. * Root documentation added! * Cleanup * JSP added * Fixed Broken Module in Spring
25 lines
817 B
Java
25 lines
817 B
Java
package com.baeldung.jsp;
|
|
|
|
import java.io.IOException;
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.annotation.WebServlet;
|
|
import javax.servlet.http.HttpServlet;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
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;
|
|
|
|
@Override
|
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
String message = request.getParameter("message");
|
|
request.setAttribute("text", message);
|
|
request.getRequestDispatcher("/jsp/ExampleThree.jsp").forward(request, response);
|
|
}
|
|
}
|