Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Passing Variables in JSP

Options
  • 14-03-2005 7:15pm
    #1
    Registered Users Posts: 3,012 ✭✭✭


    Hey,
    trying to get a Jsp page to pass info from a db to another jsp so it'll display the data relevant to that info.
    ie, you click on a link to get the info from the db relevant to that link.

    I can only find stuff about passing info from a cold fusion page to jsp.

    All I need to do is pass the String used as the link.

    If anyone can tell me what I need to do, or give me a link to a site that explains it well I'd really appretiate it.


Comments

  • Moderators, Politics Moderators Posts: 39,765 Mod ✭✭✭✭Seth Brundle


    I presume you would just need to pass an ID so page 1 makes a link with the id in it like
    <a href="page2.jsp?id=<%= resultSet.getString(1) %>">Page 2</a>
    and page2.jsp will read it in as follows:
    Int id = request.getParameter("id");
    and then pull the stuff out of the DB.

    read http://jsp.davidcastro.com/databaseoverview.jsp


Advertisement