title: Passing a JWT token and JSP page together to browser, Springboot
body: <p>Newbie here, i'm trying to pass a jwt token on the response as well as a new jsp page to the browser, but can't seem to return both together due to the methods data type(It's either String for Passing JSP or ResponseEntity&lt;&gt; for passing the token). How should i proceed about this? is there an alternative way of doing this?</p>
  <pre><code>public String createAuthenticationToken(@RequestParam(&quot;userName&quot;) String username, @RequestParam(&quot;Password&quot;) 
  String password, Model model) throws Exception {
      
      authenticate(username, password);
      
      final UserDetails userDetails = userDetailsService.loadUserByUsername(username);
      final String token = jwtTokenUtil.generateToken(userDetails);
      
  </code></pre>
  <p>/<em>This only works if methods type is ResponseEntity, but i need to pass this as well</em>/
  return ResponseEntity.ok(new JwtResponse(token));</p>
  <pre><code>    model.addAttribute(&quot;UserName&quot;,username);
      model.addAttribute(&quot;token&quot;,token);
      return &quot;homepage&quot;;
  }
  </code></pre>