0% found this document useful (0 votes)
2 views20 pages

Core Basic Java Web Server Technologies

The document provides an overview of configuring Apache Tomcat in Eclipse IDE for Java web development, focusing on Java Servlet Pages (JSP) and Java Servlets. It explains the JSP lifecycle, how to embed Java code in JSPs, and the servlet lifecycle, detailing the steps from loading the servlet class to its destruction. Additionally, it covers the differences between static and dynamic includes in JSPs and how to handle URL parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views20 pages

Core Basic Java Web Server Technologies

The document provides an overview of configuring Apache Tomcat in Eclipse IDE for Java web development, focusing on Java Servlet Pages (JSP) and Java Servlets. It explains the JSP lifecycle, how to embed Java code in JSPs, and the servlet lifecycle, detailing the steps from loading the servlet class to its destruction. Additionally, it covers the differences between static and dynamic includes in JSPs and how to handle URL parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Tools: IDE (Eclipse for

JavaEE/NetBeans) + Application
Server (Apache Tomcat/GlassFish)

Core basic
Java web Java Servlet Class
server
technologies
Java Servlet Pages - JSP
Configure Apache Tomcat in Eclipse IDE

Configure Apache Tomcat in Eclipse IDE


Create a dynamic web project
Java Servlet Pages (JSP)
•JSPs are one of the core building blocks of Java web applications, allowing us to
combine HTML and Java seamlessly

•JSP lifecycle: http://www.tutorialspoint.com/jsp/jsp_life_cycle.htm

•We can embed Java code into JSP with scriptlet tags
<% Scriplets
java.util.Date today = new java.util.Date();
String mess = "Today is "+today;
%>
<%= mess %> Output

Or
<%
java.util.Date today = new java.util.Date();
String mess = "Today is "+today;
out.println(mess);
%>
Press CTRL+Space
For deployment
How to import Java classes into JSPs
How to retrieve parameters from the URL in
JSPs
Java Servlets
Java Servlets are programs that run on a Web
or Application server and act as a middle
layer between a request coming from a Web
browser or other HTTP client and databases
or applications on the HTTP server.
Servlet Lifecycle
1. Load Servlet Class.

2. Create Instance of Servlet.

3. Call the servlets init() method.

4. Call the servlets service() method.

5. Call the servlets destroy() method.


To get some URL parameters…
Work with scriplets and HTML
The include directive vs the include jsp tag

• Static include includes something into the page, before compiling and sending it to the browser
(directive)
• Dynamic include takes place at runtime (jsp tag)
Summary of JSP tags

You might also like