I am using MYSQL database and for programming I am using JSP. Now I am extracting a value from database in my result.jsp page using this code:
String pid="";
while(resultSet.next()
{
<form action="report.jsp">
<%=resultSet.getString("patient_id") %>
<% pid=resultSet.getString("patient_id"); %>
<% request.setAttribute("acId", "pid"); %>
<input type="submit"></input>
</form>
}
pid is a variable used to store the value of Patient ID.
I want to transfer that value to another jsp page which is report.jsp
I am retrieving the value in repost.jsp as follows:
<%
String paid = (String)(request.getAttribute("acId"));
%>
Then I have to store this value in database. But no value is being tranferred and stored in the variable paid.
I have also seen this question but got no help.
Please ignore any errors as I am new to MYSQL and JSP.