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&param2=value2&...&paramn=valuen">1</a> 

if using servlets, can access user request's parameter by:

string value1 = request.getparameter("param1"); 

all parameters strings.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -