user6454491 user6454491 - 5 months ago 12
Java Question

Is it possible to assign to an html form input the value of a java String?

Is it possible to do something like this:

<form action="foo" method="get">
<input type="hidden" name="ID" value="<% classInstance.getID(); %>">
</form>


?
Each time I try, the receiving Servlet does not display the Id of the classInstance.

How can I make this work?

Answer

Try this instead :

<%= classInstance.getID() %>