There are a few possibilities, depending on what exactly you need to
do.
If the first page is going to automatically invoke the second, you can
use a jsp:include or jsp:forward, and pass the values with one or more
jsparam tags. This would look something like:
<jsp:forward page="secondpage.jsp">
<jsparam name="parameter1_name" value="parameter1_value">
<jsparam name="parameter2_name" value="parameter2_value">
...
</jsp:forward>
paramater1_value could be a simple expression, or a value of the form
<%= something %>.
If the first page requires the user to click a form submit button, the
values can be passed as hidden fields, which would look like this:
<form action="secondpage.jsp" method="POST">
<input type="hidden" name="parameter1_name" value="parameter1_value">
<input type="hidden" name="parameter2_name" value="parameter2_value">
...
<input type="submit">
</form>
Again, the parameter values can be <%= %> expressions.
If the page requires the user to click an href before proceeding, you
can pass the parameters in a query string, as in:
<a href="secondpage.jsp?paramater1_name=parameter1_value¶mater2_name=parameter2_value&... ">
Again, you can use <%= %> tags for the values, but there are some
things to watch for. If the result of the <%= %> is going to contain
any of the characters %, &, = or / you might need to urlencode the
values before they can be used. In this case, it would probably be
easer to use some session variable, as you noted.