Thread Safe Servlet
<p>I am working on a JSP MVC web application. I am confused about Thread-Safe Servlet concept. Following is my code, please tell me is it thread safe or not. Also, tell me the reason that why it is thread-safe or not thread-safe.</p>

<p>JSP Code;</p>

<pre><code> &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Personal Profile&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="PersonalData" method="post" action="PersonalDataServlet"&gt;
        First Name:&lt;input type="input" name="FirstNameField"&gt;&lt;br&gt;
        Last Name:&lt;input type="input" name="LastNameField"&gt;&lt;br&gt;
        Email:&lt;input type="input" name="EmailField"&gt;Without @ part&lt;br&gt;
        &lt;input type="Submit" value="Submit Data"&gt;
    &lt;/form&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;%
        out.print(request.getAttribute("FullName") + "\n");
        out.print(request.getAttribute("EmailAddress"));
    %&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Servlet Code;</p>

<pre><code>package Servlets;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import Model.WelcomeName;

@WebServlet("/PersonalDataServlet")
public class PersonalDataServlet extends HttpServlet {

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        String FirstNameServlet;
        String LastNameServlet;
        String EmailServlet;

        FirstNameServlet = request.getParameter("FirstNameField");
        LastNameServlet = request.getParameter("LastNameField");
        EmailServlet = request.getParameter("EmailField");

        System.out.println(FirstNameServlet + "\n" + LastNameServlet + "\n" + EmailServlet);

        WelcomeName WelcomeNameObject = new WelcomeName();
        WelcomeNameObject.Fullname(FirstNameServlet, LastNameServlet, EmailServlet);

        request.setAttribute("FullName", WelcomeNameObject.FullName);
        request.setAttribute("EmailAddress", WelcomeNameObject.EmailAddress);

        request.getRequestDispatcher("Profile.jsp").forward(request, response);

    }

}
</code></pre>

<p>Other Class Which is used to the actual calculation or Business Logic</p>

<pre><code>package Model;

public class WelcomeName {

    public String FullName;
    public String EmailAddress;

    public void Fullname(String FirstName, String LastName, String Email) {
        FullName = (FirstName + " " + LastName);
        EmailAddress = (Email + "@gmail.com");
    }

}
</code></pre>