title: I want to implement session(HTTP request)concept in my Springbootproject but its giving this error
body: <p>The Error occurs when user is registering</p>
  
  <p>Whitelabel error</p>
  
  <pre><code>  This application has no explicit mapping for /error, so you are 
    seeing this as a fallback.
    Wed Oct 24 16:46:26 IST 2018
    There was an unexpected error (type=Bad Request, status=400).
    Failed to convert value of type 'java.lang.String' to required type 
    'int'; nested exception is java.lang.NumberFormatException: For input string: ""
  </code></pre>
  
  <p>There are two forms Registration and Office</p>
  
  <p>Regitrstion(User)</p>
  
  <pre><code>@Entity
  @Table(name="mytable")
  public class User {
  
  @Id
  private int id;  //Primary key
  private String name;
  private String mobile;
  private String email;
  private String college;
  private String branch;
  private String semester;
  private String address;
  private String internship;
  private String batch;
  private String startdate;
  private String enddate;
  //getters and setters
  </code></pre>
  
  <p>Office </p>
  
  <pre><code>@Entity
  @Table(name="officeinfo")
  public class Office {
  
  @Id
  private int sno;
  private String batchno;
  private int  id;  
  private String fees;
  private String reciptno;
  private String trainer;
  //getters and setters
  </code></pre>
  
  <p>Session implementation in registration so that the id value(of office) will be filled</p>
  
  <pre><code> @PostMapping("/save-user")
   public String registerUser(@ModelAttribute User user, BindingResult 
   bindingResult, HttpServletRequest request,HttpSession 
   session,@RequestParam("id") int id) {
      userService.saveMyUser(user);
     session.setAttribute("id", id);
      int x = user.getId();
     request.setAttribute("mode", "MODE_HOME");
      return "welcomepage";
  }
  </code></pre>
  
  <p>Office page JSP for id</p>
  
  <pre><code>    &lt;div class="form-group"&gt;
      &lt;label class="control-label col-md-3"&gt;Candidate 
          Registe rNumber&lt;/label&gt;
      &lt;div class="col-md-5"&gt;
          &lt;input type="text" class="form-control                       
      placeholder="Enter Register Number" 
           name="id" required value="${sessionScope.id }" /&gt;
       &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>/<em>Project Concept</em>/</p>
  
  <p>Once a user register's(values will be stored in DB),his id should automatically be filled in the office form page and be saved in the database using the session concept but I'm getting this error please help!</p>