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

sending data with html

Options
  • 14-02-2001 1:37am
    #1
    Registered Users Posts: 6,661 ✭✭✭


    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 Posts: 6,661 ✭✭✭Blitzkrieger


    I think so - Thanks.


Advertisement