Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send innerHTML text in URL in JSP

How to send innerhtml text of a tag in url on onclick event handler in JSP page and get this value in another JSP page? Here is my code

<a href="DocumentViewer.jsp">Hello</a>

I want to send Hello with URL. Help?

like image 620
Sumit Kamboj Avatar asked Oct 17 '14 09:10

Sumit Kamboj


1 Answers

You should pass the value in URL on onclick event and get it using

request.getParameter()

in JSP page. Below is the example code

<a href="DocumentViewer.jsp?proces=something">Hello</a>

and get it in JSP like this.

String pro=request.getParameter("proces");
like image 158
Lovish Avatar answered Sep 30 '22 23:09

Lovish