
Generating an HTML Page in JSP using out.println() method
Generating an HTML Page in JSP using out.println() method
import java.io.;
import java.util.;
import javax.servlet.;
import javax.servlet.http.;
/** Simple Hello World Servlet
*/
public class HelloServlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response.getWriter( );
response.setContentType("text/html");
out.println("
Hello from a Servlet");
out.println("
This servlet ran at ");
out.println(new Date().toString( ));
out.println("
Courtesy of HelloServlet.java 1.2 ");
}
}
source: http://www.onjava.com/pub/a/onjava/excerpt/java_cookbook_ch18/index.html?page=2
Leave Generating an HTML Page in JSP using out.println() method to:
Read more #jsp posts
Best Posts From shiyonglu
We have not curated any of shiyonglu's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From shiyonglu
- Article 5: Now we have science, why do we need God?
- Article 4: Why did Jesus have to die for you?
- Article 3: Why is it so difficult to believe in God
- Article 2: if God exists, then why is there suffering?
- Article 1: Does God exist?
- NEO versus Ethereum: Why NEO might be 2018’s strongest cryptocurrency
- A commentary of Romans 12
- How to get the value from a request parameter in JSP
- Generating an HTML Page in JSP using out.println() method
- How to implement a login interface in JSP