Parameter passing in jsp using a href

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?
LVL 2
climbingjaffaAsked:
Who is Participating?
 
bloodredsunCommented:
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
 
climbingjaffaAuthor Commented:
I was missing the & symbol i had another ? there.

Thanks :-) silly me
0
 
bloodredsunCommented:
no worries, we've all done it :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.