Friday, 17 June 2016

java - JSP access global variables

I'm trying to set 2 variables in 1 JSP:



session.setAttribute("name", aName);
session.setAttribute("amount", amount);
response.sendRedirect("transferSuccess.jsp");


And trying to access this information from another JSP:





Transfer successful! Customer
<% session.getAttribute("name");%>
received $
<% session.getAttribute("amount");%>.




what's the best way to do this? My many google searches have either not worked or left me confused.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...