String value = (String) request.getParameter("value");
sometimes return null.
How can I fix this?
I am passing the value like this from page to page.
<a href=page2.jsp?value =<%=value %>"> Page2</a>
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.
You shouldn’t have any white space before the = sign in your URL, and you should have a quote before the URL:
You should also encode the parameter value, and avoid scriptlets. Use The JSTL:
Read How to avoid Java code in JSP files?
Other than that, any user may remove the parameter from the URL in its address bar, so maybe that’s the reason for a null parameter.