Could you try to construct the url little bit differently, as follows:
<td><a href=<%= "\"ShowExam.jsp?Examid=" + ex.getV_exam_id() +"\"" %> ><%= ex.getV_exam_id()%> </a> </td>
Note spaces near to <%= %> and how I give the quotation marks “\” and “\””.
This should fix it if the rest of the code you did not provide is working ok.