Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 35

Department of Computer Technology Bharati Vidyapeeth’s Jawaharlal Nehru

Institute

Of Technology Pune- 43

Affiliated to

Maharashtra State Board of Technical Education Academic Year 2022-23

Project Report

(Advanced Computer Networks)

“Resume Builder in Java Servlet”

Submitted by:-

1. Ms. Tanaya Korhalkar.


2. Ms. Janhavi Kongari.
3. Ms. Swamini Khardekar.
4. Ms. Dhyeyaja Petkar.

Under the Guidance of

Prof. Sheetal Sapate

In the Partial Fulfillment of fifth Semester of Diploma in


Computer Technology.
Certificate

This is to certify that

1. Ms. Tanaya Korhalkar. (TYCM –B) Roll No- 24

2. Ms. Janhavi Kongari. (TYCM –B) Roll No- 18

3. Ms. Swaamini Khardekar. (TYCM –B) Roll No- 42

4. Ms. Dhyeyaja Petkar. (TYCM –A) Roll No- 22

have successfully completed Micro-project in course “Computer


Technology” for the academic year 2022-23 as prescribed in the 'Assessment
Manual' during her tenure of completing Fifth Semester of Diploma
Program in Computer Technology from institute, Bharati Vidyapeeth
Jawaharlal Nehru Institute Of Technology Pune:- 43.

Course Teacher Head of the Department


Resume Builder in Java Servlet
SERVLET IN JAVA
Introduction to Java Servlets
Today we all are aware of the need of creating dynamic web pages i.e the ones
which have the capability to change the site contents according to the time or
are able to generate the contents according to the request received by the client.
If you like coding in Java, then you will be happy to know that using Java there
also exists a way to generate dynamic web pages and that way is Java Servlet.
But before we move forward with our topic let’s first understand the need for
server-side extensions.
Servlets are the Java programs that run on the Java-enabled web server or
application server. They are used to handle the request obtained from the
webserver, process the request, produce the response, then send a response back
to the webserver.
Properties of Servlets are as follows:
 Servlets work on the server-side.
 Servlets are capable of handling complex requests obtained from the
webserver.
Servlet Architecture is can be depicted from the image itself as provided below
as follows:
Execution of Servlets basically involves six basic steps:
1. The clients send the request to the webserver.
2. The web server receives the request.
3. The web server passes the request to the corresponding servlet.
4. The servlet processes the request and generates the response in the form
of output.
5. The servlet sends the response back to the webserver.
6. The web server sends the response back to the client and the client browser
displays it on the screen.
Now let us do discuss eccentric point that why do we need For Server-Side
extensions?
The server-side extensions are nothing but the technologies that are used to
create dynamic Web pages. Actually, to provide the facility of dynamic Web
pages, Web pages need a container or Web server. To meet this requirement,
independent Web server providers offer some proprietary solutions in the form
of APIs (Application Programming Interface).
These APIs allow us to build programs that can run with a Web server. In this
case, Java Servlet is also one of the component APIs of Java Platform
Enterprise Edition which sets standards for creating dynamic Web
applications in Java.
Before learning about something, it’s important to know the need for that
something, it’s not like that this is the only technology available for creating
dynamic Web pages. The Servlet technology is similar to other Web server
extensions such as Common Gateway Interface(CGI) scripts and Hypertext
Preprocessor (PHP). However, Java Servlets are more acceptable since they
solve the limitations of CGI such as low performance and low degree
scalability.
What is CGI?
CGI is actually an external application that is written by using any of the
programming languages like C or C++ and this is responsible for processing
client requests and generating dynamic content.
In CGI application, when a client makes a request to access dynamic Web
pages, the Web server performs the following operations :
 It first locates the requested web page i.e the required CGI application using
URL.
 It then creates a new process to service the client’s request.
 Invokes the CGI application within the process and passes the request
information to the application.
 Collects the response from the CGI application.
 Destroys the process, prepares the HTTP response, and sends it to the
client.
So, in CGI server has to create and destroy the process for every request. It’s
easy to understand that this approach is applicable for handling few clients but
as the number of clients increases, the workload on the server increases and so
the time is taken to process requests increases.

Servlets API’s:
Servlets are build from two packages:
 javax.servlet(Basic)
 javax.servlet.http(Advance)
Various classes and interfaces present in these packages are:
Component Type Package
Servlet Interface javax.servlet.*
ServletRequest Interface javax.servlet.*
ServletResponse Interface javax.servlet.*
GenericServlet Class javax.servlet.*
HttpServlet Class javax.servlet.http.*
HttpServletRequest Interface javax.servlet.http.*
HttpServletResponse Interface javax.servlet.http.*
Filter Interface javax.servlet.*
ServletConfig Interface javax.servlet.*
Advantages of a Java Servlet

 Servlet is faster than CGI as it doesn’t involve the creation of a new


process for every new request received.
 Servlets, as written in Java, are platform-independent.
 Removes the overhead of creating a new process for each request as
Servlet doesn’t run in a separate process. There is only a single instance
that handles all requests concurrently. This also saves the memory and
allows a Servlet to easily manage the client state.
 It is a server-side component, so Servlet inherits the security provided by
the Web server.
 The API designed for Java Servlet automatically acquires the advantages of
the Java platforms such as platform-independent and portability. In
addition, it obviously can use the wide range of APIs created on Java
platforms such as JDBC to access the database.
 Many Web servers that are suitable for personal use or low-traffic
websites are offered for free or at extremely cheap costs eg. Java servlet.
However, the majority of commercial-grade Web servers are rather
expensive, with the notable exception of Apache, which is free.
HTML IN JAVA

Introduction to HTML in Java

HTML stands for HyperText Markup Language. It is used to design web pages
using a markup language. HTML is the combination of Hypertext and Markup
language. Hypertext defines the link between web pages. A markup language
is used to define the text document within the tag which defines the structure
of web pages. This language is used to annotate (make notes for the computer)
text so that a machine can understand it and manipulate text accordingly. Most
markup languages (e.g. HTML) are human-readable. The language uses tags to
define what manipulation has to be done on the text.

HTML is a markup language used by the browser to manipulate text, images,


and other content, in order to display it in the required format. HTML was
created by Tim Berners-Lee in 1991. The first-ever version of HTML was HTML
1.0, but the first standard version was HTML 2.0, published in 1995.
Elements and Tags: HTML uses predefined tags and elements which tell the
browser how to properly display the content. Remember to include closing
tags. If omitted, the browser applies the effect of the opening tag until the end
of the page.

HTML page structure: The basic structure of an HTML page is laid out below. It
contains the essential building-block elements (i.e. doctype declaration, HTML,
head, title, and body elements) upon which all web pages are created.
<!DOCTYPE html>: This is the document type declaration (not technically a
tag). It declares a document as being an HTML document. The doctype
declaration is not case-sensitive.

<html>: This is called the HTML root element. All other elements are contained
within it.

<head>: The head tag contains the “behind the scenes” elements for a
webpage. Elements within the head aren’t visible on the front-end of a
webpage. HTML elements used inside the <head> element include:

 <style>-This html tag allows us to insert styling into our webpages and
make them appealing to look at with the help of CSS.

 <title>-The title is what is displayed on the top of your browser when you
visit a website and contains title of the webpage that you are viewing.

 <base>-It specifies the base URL for all relative URL’s in a document.

 <noscript>– Defines a section of HTML that is inserted when the scripting


has been turned off in the users browser.

 <script>-This tag is used to add functionality in the website with the help
of JavaScript.

 <meta>-This tag encloses the meta data of the website that must be
loaded every time the website is visited. For eg:- the metadata charset
allows you to use the standard UTF-8 encoding in your website. This in
turn allows the users to view your webpage in the language of their
choice. It is a self closing tag.

 <link>– The ‘link’ tag is used to tie together HTML, CSS and JavaScript. It is
self closing.
Source Code:

index.html:
<!DOCTYPE html>
<html>
<head>
<title>Create you Resume Here!</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body bgcolor="Silver">

<H1 style="color:slateblue;"> Personal Information</H1><br>


<form action="Resume" method="post">
Your Name : <input type="text" name="name"/><br/>
Fathers Name : <input type="text" name="fathersname"/><br/>
Residential Address : <input type="text" name="address"/><br/>
Phone Number : <input type="text" name="phonenumber"/><br/>
Email ID : <input type="text" name="emailid"/><br/>
Date of Birth: D <select name="Date">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
M <select name="Month">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
Y <select name="Year">
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1992</option>
<option value="1993">1993</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
</select><br>
<h1 style="color:slateblue;"> Qualification Related Information: </h1><br>
<h3 style="color:slateblue;">Graduation</h3><br>
Course: <input type="text" name="Course1"/> <br>
Grade:<select name="Grade1">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="D">C</option>
<option value="E">E</option>
</select>
Passing Year : <input type="text" name="passingyear1"/><br/>
<h3 style="color:slateblue">Intermediate: </h3><br>
Course: <input type="text" name="Course2"/> <br>
Grade:<select name="Grade2">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="D">C</option>
<option value="E">E</option>
</select>
Passing Year : <input type="text" name="passingyear2"/><br/>
<h3 style="color:slateblue">Matriculation: </h3><br>
Course: <input type="text" name="Course3"/><br>
Grade:<select name="Grade3">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="D">C</option>
<option value="E">E</option>
</select>
Passing Year : <input type="text" name="passingyear3"/><br/>

<h1 style="color:slateblue;"> Experience: </h1><br>

Organization name : <input type="text" name="org1"/>


Designation : <input type="text" name="desig1"/>
Years of Experience: <select name="Years1">
<option value="<1"><1</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value=">10">>10</option>
</select> <br>
Organization name : <input type="text" name="org2"/>
Designation : <input type="text" name="desig2"/>
Years of Experience:<select name="Years2">
<option value="<1"><1</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value=">10">>10</option>
</select> <br>
Organization name : <input type="text" name="org3"/>
Designation : <input type="text" name="desig3"/>
Years of Experience:<select name="Years3">
<option value="<1"><1</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value=">10">>10</option>
</select><br>
<h1 style="color:slateblue;"> Skills: </h1><br>
Hobbies and Interests: <br><input type="text" name="h1"/> <input type="text"
name="h2"/> <br> <input type="text" name="h3"/> <input type="text" name="h4"/>
<br>
<br>
Programming Languages Known: <br><input type="radio" name="lang1" value="C" />C
<br>
<input type="radio" name="lang2" value="C++" />C++<br>
<input type="radio" name="lang3" value="Java" />Java<br>
<input type="radio" name="lang4" value="JavaScript" />JavaScript<br>
<input type="radio" name="lang5" value="Python" />Python<br>
<input type="radio" name="lang6" value="C#" />C#<br>
<input type="radio" name="lang7" value="HTML-CSS" />HTML-CSS<br>
Any other <input type="text" name="lang8" /><br>
<br>
<input type="submit" value="Generate Resume"/>
</form>
</body>
</html>

Servlet:
import java.io.IOException;
import java.io.PrintWriter;
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("/Resume")
public class Resume extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
{
String name=request.getParameter("name");
String fathername=request.getParameter("fathersname");
String address=request.getParameter("address");
String phonenumber =request.getParameter("phonenumber");
String emailid=request.getParameter("emailid");
String date=request.getParameter("Date");
String month=request.getParameter("Month");
String year=request.getParameter("Year");
String course1=request.getParameter("Course1");
String course2=request.getParameter("Course2");
String course3=request.getParameter("Course3");
String grade1=request.getParameter("Grade1");
String grade2=request.getParameter("Grade2");
String grade3=request.getParameter("Grade3");
String py1=request.getParameter("passingyear1");
String py2=request.getParameter("passingyear2");
String py3=request.getParameter("passingyear3");
String org1=request.getParameter("org1");
String desig1=request.getParameter("desig1");
String Years1=request.getParameter("Years1");
String org2=request.getParameter("org2");
String desig2=request.getParameter("desig2");
String Years2=request.getParameter("Years2");
String org3=request.getParameter("org3");
String desig3=request.getParameter("desig3");
String Years3=request.getParameter("Years3");
String h1=request.getParameter("h1");
String h2=request.getParameter("h2");
String h3=request.getParameter("h3");
String h4=request.getParameter("h4");
String r1=request.getParameter("lang1");
String r2=request.getParameter("lang2");
String r3=request.getParameter("lang3");
String r4=request.getParameter("lang4");
String r5=request.getParameter("lang5");
String r6=request.getParameter("lang6");
String r7=request.getParameter("lang7");
String r8=request.getParameter("lang8");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.print("<h1>Resume</h1> <br/>");
out.print("<h3><u>Personal Information</u></h3><br/>");
out.print("Name :"+name+"<br>");
out.print("Father's name : "+ fathername +"<br/>");
out.print("Resisential Address : "+ address +"<br/>");
out.print("Contact Number : "+ phonenumber +"<br/>");
out.print("Email Address : "+ emailid +"<br/>");
out.print("Date of Birth :"+date+ " "+month+" "+year);
out.print("<h3><u>Qualification Related Information</u></h3><br/>");
out.print("<h2><b>Graduation:</b></h2><br/>");
out.print("Course : "+course1+"<br/>");
out.print("Grade : "+grade1+"<br/>");
out.print("Year of Passing : "+py1+"<br/>");
out.print("<h2><b>Intermediate:</b></h2><br/>");
out.print("Course : "+course2+"<br/>");
out.print("Grade : "+grade2+"<br/>");
out.print("Year of Passing : "+py2+"<br/>");
out.print("<h2><b>Matriculation:</b></h2><br/>");
out.print("Course : "+course3+"<br/>");
out.print("Grade : "+grade3+"<br/>");
out.print("Year of Passing : "+py3+"<br/>");
out.print("<h3><u>Experience</u></h3><br/>");
out.print("Organisation's Name : "+org1+"<br/>");
out.print("Designation : "+desig1+"<br/>");
out.print("Years of Experience: "+Years1+"<br/>");
out.print("Organisation's Name : "+org2+"<br/>");
out.print("Designation : "+desig2+"<br/>");
out.print("Years of Experience: "+Years2+"<br/>");
out.print("Organisation's Name : "+org3+"<br/>");
out.print("Designation : "+desig3+"<br/>");
out.print("Years of Experience: "+Years3+"<br/>");
out.print("<h3><u>Skills</u></h3><br/>");
out.print("Hobbies and Interests : <br>"+ h1+"<br>"+h2+"<br>"+h3+" "+h4+"<br>");
String a="Any Other-";
out.print("Programming Languages Known : <br>"+ r1+"<br>"+r2+"<br>"+
r3+"<br>"+ r4+"<br>" + r5+"<br>"+ r6+"<br>"+ r7+"<br>"+a+" "+r8);
out.print("</body></html>");

You might also like