Your first step should be to find out which of those things generates the HTML you want. (Use "View Page Source" in your browser.) If none of them do, then make the appropriate changes or ask a question here in which you post the desired HTML as well as your proposed JSP code.
What do you mean by dynamic here ? if you store the value "enter query" in JSP scriplet variable and use it in same JSP , is that dynamic ? if the text value is generated out of some logic , then it can be said dynamic and this logic is more appropriate to be coded inside servlet or helper class and exposed as scoped variable to be used in JSP.