I have search functionality in my jsp page.. When user types “abc” and search for that. I get the result back but is there a way to retrieve that abc back to that search textbox along with the search results? Thank you.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just prefill the input value with the submitted value. Submitted input values are available in EL via the
${param}request parameter map keyed by input field names.Note the importance of JSTL
fn:escapeXml(). It’s to prevent your page from XSS attacks while redisplaying user-controlled input.The above example will prefill the input value with the result of
request.getParameter("query"). As EL is null-safe, it won’t display anything if it returnsnull.See also: