getParameter returns null in the servlet -
this question has answer here:
i trying pass string jsp servlet via href. use this
<a href="myservlet?select=title1"> title1 </a>
then in servlet trying value of select this
string s = request.getparameter("select");
but returns null
. why that? thank you!
edit post code of servlet
protected void processrequest(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { string useroption = request.getattribute("select"); system.out.println("select is:" + useroption); //in console get: select is:null
that should not string useroption = request.getattribute("select");
please understand attributes not parameters
it should string useroption = request.getparameter("select");
Comments
Post a Comment