Introduction to JSP and Servlet



What is servlet?

LifeCycle methods in servlet

Fig. Lifecycle of servlet.

Java Server Pages(JSP)

What is JSP?

JSP Scripting

<% any normal java code will work here. but declarative code will not %>
<% if(password.length() < 6) { errorMessage = "Enter correct password"} %>
<%= veriable-name %>
<p>First Name of a user is := <%= firstName %></p>
<%! declarative code here %>
public boolean validateEmail(String email) {
// code for validation.
<%@page errorPage="error.jsp" /> // here this page gets called whenever error occurs.
<%@ include file="filepath"%>
<%@ taglib prefix = "mytag" uri=""%>




Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store