Reading Form Submission Variables
You use the request.getParameter() method in JSP to request form submissions variables, similar to the Request.Form() method in VBscript ASP.
<% out.print("myfield=" + request.getParameter("myfield")); %>
Note: Make sure the “action=” attribute matches the name of the file you paste this code into.
Declaring and Reading Session Variables
Use the session.setAttribute() method to set a session variable:
<%
session.setAttribute( "mySessionVariable", "Hello World" );
%>
Use the session.getAttribute() method to retrieve the value of a session variable:
<%= session.getAttribute( "mySessionVariable" ) %>
This will return the following:
Hello World


