I want to pass a variable to a servlet with my own value .
Using that :
<input type="text" name="usernameNew"><br>
I can grab the usernameNew in the servlet , but I’d need to let the user put some input into that text-field – and that I don’t want .
What I want is to set the value of usernameNew to something , in the JSP page , for instance a String with the value myText , without asking the user to put any input (meaning , I want the usernameNew to be some kind of a flag , and use that in my servlet for IF conditions) .
Regards
Use a hidden input. Either that or add it to a normal field but make it read-only. That way the user can see, but not change, the data.
And note this this is really about forms in HTML.