Parameter passing in jsp using a href

Posted on 2005-04-07
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?
Question by:climbingjaffa
    LVL 29

    Accepted Solution

    What does it look like in your request?


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

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

    Author Comment

    I was missing the & symbol i had another ? there.

    Thanks :-) silly me
    LVL 29

    Expert Comment

    no worries, we've all done it :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now