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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -