text not showing
<h1>JSP Page</h1>
this text shows
<jsp:include page="/IncludeHandler" flush="true"/>//myservlet
this text does not show
</body>
</html>
<h1>JSP Page</h1>
this text shows
<jsp:include page="/IncludeHandler" flush="true"/>//myservlet
this text does not show
</body>
</html>
package web;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*
* @author javious
* @version
*/
public class IncludeTest extends HttpServlet {
/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<h3>Hi! I'm a servlet who is included!</h3>");
// DON't CLOSE YOUR OUTPUT STREAM!!! YOUR ONLY INCLUDED, NOT THE FINAL WORD!
//out.close();
}
}
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
this text shows
<jsp:include page="/IncludeTest" flush="true"/>//myservlet
this text shows
</body>
</html>