Is it possible to pass parameters to servlet/jsp using a href link? If so can anybody give an example to show how it can be done?
Thanks
Of course:
<a href="link.do?user=31"/>
Read it in your servlet handling link.do
URI:
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
req.getParameter("user") //equals "31"
}
Or if it's a servlet (link.jsp
):
<%= request.getParameter("user") %>
...or better with jstl:
${param.age}