Files
spring-boot-rest/spring-mvc-xml/src/main/java/com/baeldung/jsp/ExampleThree.java
Adam InTae Gerard a3e623622b BAEL-426: Guide to JSP (#803)
* 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
2016-12-12 05:18:50 -06:00

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);
}
}