java - How to pass a certain amount of data when clicking a link in html? -
how can pass specific set of data when click link? example
<a href="1.jsp">1</a> <a href="2.jsp">2</a>
i want pass 1 clicking 1 , pass 2 clicking 2. how can ?
you can encode arbitrary parameters following syntax:
<a href="1.jsp?param1=value1¶m2=value2&...¶mn=valuen">1</a>
if using servlets, can access user request's parameter by:
string value1 = request.getparameter("param1");
all parameters strings.
Comments
Post a Comment