passing data between jsp pages

Discussion in 'JSP' started by clarky, Apr 28, 2010.

  1. clarky

    clarky New Member

    Joined:
    Apr 28, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0

    Part 1


    I'm populating a dropdown list from data retrieved from a web services request. When the user makes a selection I want to link to another jsp page passing the selected item as the value of parm1.

    <select onchange="document.location='./otherPage.jsp?parm1='+this.value;" >

    This works fine if 1. the user is using firefox, not ie and, 2. there is no spaces in the selected item.

    If ie, the linked adress is shown as...
    .../otherPage.jsp?parm1=

    In firefox its...
    .../otherPage.jsp?parm1=ITEM_1


    Part 2


    The second part of my issue relates to the linked jsp page where I use...
    String[] ws_parm1 = request.getParameterValues("parm1");

    I have to receive parm1 as an array though I want it as a single string.

    any assistance would be appreciated.
     
  2. clarky

    clarky New Member

    Joined:
    Apr 28, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Ignore Part 2, Ive sorted that out by replacing the spaces with another character and the reverting back to spaces in the receiving jsp...
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Why don't you make the form post as Get instead of you doing all the passing.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice