I want to pass a variable to servlet, using a form in a jsp file:
<form action="userSrevlet">
<input name="username" type="hidden" value="<%=username%>"/>
<input type="submit" value="User"/>
</form>
However I get
HTTP Status 500 - Unable to compile class for JSP
error after adding the value of the variable that way. How can I send it?
You might be getting error due missing value for username i.e. username variable is not found or set. Better way is to use EL i.e. ${username} which will take set value="" if username is not found.