[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Parameter passing in jsp using a href

Posted on 2005-04-07
3
Medium Priority
?
1,039 Views
Last Modified: 2012-05-05
How do you pass more than one parameter in a href.

I need the first parameter to get cast in to an int and the second to a string when my servlet recieves them but im getting a number format exception so its as if its seeing the whole lot as one parameter?
0
Comment
Question by:climbingjaffa
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
bloodredsun earned 500 total points
ID: 13726840
What does it look like in your request?

page.jsp?param1=123454&param2=Hello

jsp code
      int iParam = Integer.parseInt(request.getParameter("param1"));
      String strParam = request.getParameter("param2");

or do you have params of the same name?
0
 
LVL 2

Author Comment

by:climbingjaffa
ID: 13726885
I was missing the & symbol i had another ? there.

Thanks :-) silly me
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13727063
no worries, we've all done it :-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will be showing you how to subnet the easiest way possible for IPv4 (Internet Protocol version 4). This article does not cover IPv6. Keep in mind that subnetting requires lots of practice and time.
Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question