0

i have a jsp page which have a some school names link. when i click to link of a school name, school name are appended to a link that will go to a second page.
in this second page have same item which i will use same for all school. i want to know how to attach a request parameter in a link using in second page which appended from first page so that i can access navigate the data based on school name.

please suggest.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by vij123
0

Your question doesn't make much sense but I will give you an example in case it helps:

PAGE 1:

<a href="page2.jsp?name=someSchool&address=someA&number=11">Link in page 1</a>

PAGE 2: (page2.jsp)

<%
String name = request.getParameter("name");
String address= request.getParameter("address");
String number= request.getParameter("number");
%>


<a href="page2.jsp?name=<%=name%>&address=<%=address%>&number=<%=number%>">Link in page 2</a>

Inside the <%=%> you put the java variable. You can name the variable whatever you want. But inside the request.getParameter("") you must put as String what you used at the link as name of the parameter:

?name=someSchool
request.getParameter("name")

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.