在JSP中的URL中发送innerHTML文本

Sum*_*boj 6 url jsp onclick innerhtml send

如何在JSP页面的onclick事件处理程序中在url中发送标记的innerhtml文本,并在另一个JSP页面中获取该值?这是我的代码

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

我想发送带URL的Hello.救命?

Lov*_*ish 2

您应该在 onclick 事件的 URL 中传递值并使用

request.getParameter()
Run Code Online (Sandbox Code Playgroud)

在JSP页面中。下面是示例代码

<a href="DocumentViewer.jsp?proces=something">Hello</a>
Run Code Online (Sandbox Code Playgroud)

并像这样在 JSP 中获取它。

String pro=request.getParameter("proces");
Run Code Online (Sandbox Code Playgroud)