Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

sending data with html

  • 14-02-2001 01:37AM
    #1
    Registered Users, Registered Users 2 Posts: 6,676 ✭✭✭


    I'm supposed to do this servlet where I display a number of html links. When the user clicks on a link, they go to a page where the servlet runs it's doGet method. Every link leads to the same page so I need to find a way of sending some info with the request. None of the books in the library seem to give good examples and I've just spent 4 hours looking for an example online. Anybody done this before?


Comments

  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    You need to pass parameters to the servlet from the URL in the link.
    like this ....site.com/servlet.jsp?page=page1
    ....site.com/serlvet.jsp?page=page2

    Then in your doGet method you can pic them up from the request like so:
    String page = request.getParameter("page");

    Is this what you mean?


  • Registered Users, Registered Users 2 Posts: 6,676 ✭✭✭Blitzkrieger


    I think so - Thanks.


Advertisement