title: Instantiate Javabean
body: <p>Hi is this the correct way to instantiate a javabean? in school, we are taught to use the<br>
  <code>&lt;% usebean id="something" class="package.java" ...%&gt;</code> xml tag.  </p>
  
  <p>However in some tutorials, i see people are using this:  </p>
  
  <pre><code>&lt;th&gt;Welcome &lt;%UserBean currentUser = (UserBean)session.getAttribute("currentSessionUser"));%&gt;&lt;%= currentUser.getUsername()%&gt;&lt;/th&gt;
  </code></pre>
  
  <p>is it advisable to do the above code in jsp?</p>