aspose file tools*
The moose likes JSP and the fly likes Passing an Int from JSP to java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Passing an Int from JSP to java" Watch "Passing an Int from JSP to java" New topic
Author

Passing an Int from JSP to java

Larry Mater
Greenhorn

Joined: Aug 08, 2006
Posts: 2
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

Joined: Jan 10, 2002
Posts: 60048
    
  65

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Larry Mater
Greenhorn

Joined: Aug 08, 2006
Posts: 2
thank you Bear. big help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing an Int from JSP to java
 
Similar Threads
How to send comands to anoyther program
How do i improve variable visibility?
Write a method that can be called, that will initialize the seating plan.
displaying next record in DB using ResultSet
Implementation of google charts in JSP