newbie question about jsp and html

Discussion in 'Java' started by Jason, May 27, 2004.

  1. Jason

    Jason Guest

    Hi, just a simple question about jsp and html, how can I pass a value between
    two jsp pages? For example, when use click 'submit' button at page 1, then
    textField 1(page 1) will pass to textField 2(page 2)?

    Thanks.
     
    Jason, May 27, 2004
    #1
    1. Advertising

  2. Jason

    SPG Guest

    If you ar enot using struts (and I suggest you do), then simply stick the
    value in the session on submit. Then pull it back out when you need it


    "Jason" <> wrote in message
    news:...
    >
    > Hi, just a simple question about jsp and html, how can I pass a value

    between
    > two jsp pages? For example, when use click 'submit' button at page 1, then
    > textField 1(page 1) will pass to textField 2(page 2)?
    >
    > Thanks.
     
    SPG, May 27, 2004
    #2
    1. Advertising

  3. Jason

    Ryan Stewart Guest

    "SPG" <> wrote in message
    news:eek:4utc.4605$...
    *fixed top post*
    > "Jason" <> wrote in message
    > news:...
    > >
    > > Hi, just a simple question about jsp and html, how can I pass a value

    > between
    > > two jsp pages? For example, when use click 'submit' button at page 1,

    then
    > > textField 1(page 1) will pass to textField 2(page 2)?
    > >
    > > Thanks.

    >
    > If you ar enot using struts (and I suggest you do), then simply stick the
    > value in the session on submit. Then pull it back out when you need it
    >

    That's plain silly. If you have a form on page 1 which submits to page 2,
    and in that form you have a text box named "text1" (<input type="text"
    name="text1">), then do this in page 2:
    <%
    String value = request.getParameter("text1");
    %>

    <form action="someOtherPage.jsp">
    <input type="text" name="anotherTextbox" value="<%= value %>">
    </form>
     
    Ryan Stewart, May 28, 2004
    #3
  4. Jason

    SPG Guest

    Ooopss.. and Blush!
    Yes, I am sorry for the mis-info. Consider myself reprimanded.

    That is becuase I have been using Strunts (and not to very good effect! ;)
    and that uses the old FormBean jobbie..)
    Cheers for the correction!

    Steve
    "Ryan Stewart" <> wrote in message
    news:...
    > "SPG" <> wrote in message
    > news:eek:4utc.4605$...
    > *fixed top post*
    > > "Jason" <> wrote in message
    > > news:...
    > > >
    > > > Hi, just a simple question about jsp and html, how can I pass a value

    > > between
    > > > two jsp pages? For example, when use click 'submit' button at page 1,

    > then
    > > > textField 1(page 1) will pass to textField 2(page 2)?
    > > >
    > > > Thanks.

    > >
    > > If you ar enot using struts (and I suggest you do), then simply stick

    the
    > > value in the session on submit. Then pull it back out when you need it
    > >

    > That's plain silly. If you have a form on page 1 which submits to page 2,
    > and in that form you have a text box named "text1" (<input type="text"
    > name="text1">), then do this in page 2:
    > <%
    > String value = request.getParameter("text1");
    > %>
    >
    > <form action="someOtherPage.jsp">
    > <input type="text" name="anotherTextbox" value="<%= value %>">
    > </form>
    >
    >
     
    SPG, May 28, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sunitha Kumar
    Replies:
    0
    Views:
    441
    Sunitha Kumar
    Jul 7, 2003
  2. DigitalUncle
    Replies:
    0
    Views:
    994
    DigitalUncle
    Nov 2, 2004
  3. Replies:
    0
    Views:
    4,547
  4. Replies:
    2
    Views:
    542
  5. zalek
    Replies:
    1
    Views:
    398
Loading...

Share This Page