문제

jsp code to know which link is clicked in previous page, based on that to change the web page content of second page. Help me to write code for this.

도움이 되었습니까?

해결책

Assuming you have one JSP for all links, do something like this:

main.jsp:

<ul>
  <li><a href="detail.jsp?link=page1">Page 1</a></li>
  <li><a href="detail.jsp?link=page2">Page 2</a></li>
</ul>

detail.jsp:

<h1>I am on Detail Page</h1>
<% String link = request.getParameter("link"); %>

Then use this variable as per your need.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top