session.jsp Created a jsp file and Started and Setted the session attributes.
session=request.getSession();
session.setAttribute("eid", Employee_Id);
session.setAttribute("Employee_name", rs.getString(2));
Getsession.jsp In this file i am getting the session attribute Employee_name by using.
<%
String name=(String)session.getAttribute("Employee_name");
out.print(name);
%>
Getsession.js In this js file i am trying to get the session attribute eid which i need to pass to ajax call to fetch image file.
But I am not getting the value that i required.
function GetImg()
{
var value = `<% session.getAttribute("eid"); %>`;
alert(value);
}
Result i am getting is an alert message like this @Request.RequestContext.HttpContext.Session["eid"]'
i am not getting eid value.