Is it possible to do something like this:
<form action="foo" method="get"> <input type="hidden" name="ID" value="<% classInstance.getID(); %>"> </form>
Try this instead :
<%= classInstance.getID() %>