Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing an Int from JSP to java

 
Larry Mater
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For strings I have been using getParameter() to get values that were input in my jsp pages.

Now what i can't seem to do it the same for integers. 2 things.

How do i define an integer rowstart with the value of 1 as hidden so I can pass it to my java programs and then how do I request that value from the jsp in my java program. If it was a string i would do input rowstart then do the getparamter("rowstart") in my java. How do I do integers?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64849
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Larry Mater:

How do i define an integer rowstart with the value of 1 as hidden





how do I request that value from the jsp in my java program.


All request parameters are strings, so you'd get the value of "rowstart" the same way as any other; with request.getParameter(). After obtaining the string value, you can use Integer.parseInt() to convert the string to its integer equivalent.
[ August 08, 2006: Message edited by: Bear Bibeault ]
 
Larry Mater
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Bear. big help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic