title: request parameters and add as session attributes
body: <p>I was given this as an in class problem and recievd 0 as the result, but I can't find the fault with it. The questions is <strong>Write the lines of code you would need to use in a servlet to retrieve a parameter
  from an incoming request and add it to the session as an attribute:</strong></p>
  
  <p>My answer:</p>
  
  <pre><code>String param1= request.getParameter("param1");
  
  HttpSession session= request.getSession();
  String parameter1= (String)request.getAttribute("param1");
  session.setAttribute("param1", parameter1);
  </code></pre>
  
  <p>Also, is the '(String)' necessary in the second line? or just good practice? 
  Thanks :)</p>