sending textbox info from one page to another

Discussion in 'JSP' started by tefbaez, Jul 25, 2008.

  1. tefbaez

    tefbaez New Member

    Joined:
    Jul 25, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hey there, I need help with something... I need to create 2 .jsp pages, one with a textbox in which you submit a name, and the second one should display it when you i click the submit button...but i cant seem to get it right =S

    this is what ive got on the first page

    <html>
    <body>
    <form name="pagina" method="get" action="pagina2.jsp">
    Nombre:
    <input type="text" name="usuario">
    <input type="submit" value="submit">
    </form>
    </body>
    </html>

    Oh, i MUST use the get method, i was told to... so if anyone can guide me id very much appreciate it!
    tia.
     
  2. bitwords

    bitwords New Member

    Joined:
    Feb 19, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.bitwords.com
    Irrespective of whether you use get or post, you can get the values on next .jsp page using request.getparameter() and store it into the string:

    String txt = request.getParameter("usuario");

    Then you can simply print the string :).
     

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