How I can set an attribute in a session using expression language in the following code
<body>
<h1>Hello ${param.name}!</h1>
<% String n = $ {param.name} %>
<%
session.setAttribute("user", n);
%>
<a href="process.jsp">visit</a>
</body>
By using the following code you can set values to the session variable:
<c:set var="user" value="${param.name}" scope="session" />
To print the session variable:
<c:out value="${sessionScope.user}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With