Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

to get boolean value in jsp  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can you please tell me how to get boolean value in jsp.Means i want to get a value whose value is being passed from javascript to jsp.
It makes you clear my prob.

like for passing any string value(say name). we use..
<SCRIPT>
function form
...
..
document.formname.action="formname.jsp?name="+name; location.href = document.formname.action;
</SCRIPT>
String name;

name = request.getParameter("name");


like if i want to pass a boolean value then..how to do it..

thanks ....
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gaurav,

HttpRequest.getParameter() has a return type as a String in it's signature. You can't get any other data-type from request.

Thanks
Dhananjay
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As said previously, getParamter only returns String.
So use that String to instanciate a Boolean.
Look at the constructor Boolean(String s).
"true" is true.
Everything else is false.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!