I am trying to pass a string parameter that has html content in it.
<%
String myparam = "<td>some text</td>";
%>
<td>
<a href="page.jsp?myparam=<%=myparam%>">Visit W3Schools</a>
</td
It fails to send and recognizes my string as html code.
This should be indeed possible. To insert the value of a variable, use
<%= %>
like this:
<a href="page.jsp?myparam=<%=myparam%>">Visit W3Schools</a>
But sending html inside a url is not a good idea. It´s easy to manipulate and you will get security issues due to code injection.
And if you really really need to send html in the url, you need to escape the html specific characters.
<a href=<%= "page.jsp?myparam="<%=myparam%>"" %> >Visit</a>