title: null response send by servlet to jsp
body: <pre><code> &lt;%@ page import="java.util.*" %&gt;
   &lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;
   &lt;body&gt;
   &lt;form name="loginform" method="post" action="WelcomeServlet"&gt;
   &lt;br&gt;&lt;br&gt;
    &lt;table align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;h2&gt;Login Authentication&lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
    &lt;table width="300px" align="center" style="border:1px solid #000000;backgroundcolor:#efefef;"&gt;
        &lt;tr&gt;&lt;td colspan=2&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td colspan=2&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Login Name&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="username" &gt;&lt;/td&gt;
     &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Password&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="password" name="password"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="submit" name="Submit" value="Submit"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;&lt;td colspan=2&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
       &lt;/table&gt;&lt;br&gt;&lt;br&gt;&lt;/br&gt;&lt;/br&gt;
      &lt;p&gt;
    &lt;%
       String mess="";
       mess=(String)request.getAttribute("Message");
       out.println("="+mess);
     %&gt;
     &lt;/p&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>then this servlet</p>
  
  <pre><code> import java.io.*;
   import java.util.*;
    //import java.io.PrintWriter;
    import javax.servlet.*;
    //import javax.servlet.ServletConfig;
   //import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  public class WelcomeServlet extends HttpServlet {
   /* 
   @Override
   public void init(ServletConfig config) throws ServletException {
     super.init(config);
   }
  */
  
   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  /*
    * Get the value of form parameter
  */
   try  
   {
     response.setContentType("text/html");
  
      PrintWriter out = response.getWriter();
     //out.println("I am on welcome servlet...");
     String username = request.getParameter("username");
     String password =request.getParameter("password");
     System.out.println("username="+username);
     System.out.println("password="+password);
     System.out.println("response="+password);
     String welcomeMessage="";
     out.println("&lt;html&gt;");
       out.println("&lt;head&gt;");
       out.println("&lt;title&gt; A very simple servlet example&lt;/title&gt;");
       out.println("&lt;/head&gt;");
        out.println("&lt;body&gt;");
    if(username.equals("")&amp;&amp; username.equals("null")&amp;&amp; password.equals("")&amp;&amp; password.equals("null"))
        {
           welcomeMessage="username or password can not be blanked....";
           out.println("&lt;h1&gt;"+welcomeMessage+"&lt;h1&gt;");
         }else{       
               if((username.equals("kiran"))&amp;&amp;(password.equals("kiran")))
               {
  
              welcomeMessage = "Welcome "+username+" thanks for login...";
             out.println("&lt;h1&gt;"+welcomeMessage+"&lt;/h1&gt;");
  
               }else
                   { 
  
              welcomeMessage="You are not the valid user...";
             out.println("&lt;h1&gt;"+welcomeMessage+"&lt;/h1&gt;");
  
  
                   }
  
            }
        out.println("&lt;/body&gt;");
        out.println("&lt;/html&gt;");
        RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
        rd.forward(request, response);
        request.setAttribute("Message",welcomeMessage);
          //out.close();
  
  }
  catch( Exception e )  
  {  
      e.printStackTrace();  
      //throw e;  
  }  
    }
  
    public void destroy() {
     }
   } 
  </code></pre>
  
  <p>in this mvc im getting null after execution of mvc ..please give solution as early as possible</p>