Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2005, 10:57 PM
Authorized User
 
Join Date: Jan 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting Integers from the query string

I have a maddeningly simple question I can't seem to get resolved with the resources to hand.

I've got a simple, simple task. I've got a page "details.asp" which gives details about an item. There are 18 such items. I'm making a simple NEXT/PREV set of buttons, and want to have it just go to the next item.

If I have details.jsp?id=1, I have code which says:

String theID;

theID = request.getParameter("id");


This makes "id" a string, however, and I can't increment it or do anything with it. How do I make a query string element into an integer which I can increment?

Any help would be great.

--tad


Thaddeus G. Reeves
Internet Dissemination
Church of Scientology Int'l
__________________
Thaddeus G. Reeves
Internet Dissemination
Church of Scientology Int\'l
 
Old March 16th, 2005, 11:03 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

int myIny = Integer.parseInt(theID);

HTH

--
Don't Stand on your head - you'll get footprints in your hair. http://www.charlieharvey.org.uk
 
Old March 16th, 2005, 01:22 PM
Authorized User
 
Join Date: Jan 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. That works.

--tgr


Thaddeus G. Reeves
Internet Dissemination
Church of Scientology Int'l





Similar Threads
Thread Thread Starter Forum Replies Last Post
Query string value SKhna ASP.NET 2.0 Basics 1 March 17th, 2008 07:27 AM
Unsigned integers AndrewH Java Basics 1 September 26th, 2006 02:46 PM
Using integers with text boxes clojinted General .NET 1 February 19th, 2005 08:12 PM
Query String Baby_programmer ASP.NET 1.0 and 1.1 Basics 3 December 24th, 2004 11:14 AM
Query String Nitin_sharma VBScript 1 December 16th, 2004 07:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.