As a good practice
you should be using out.println() repetitively instead of fighting with <% tags :-) As behind the scenes, the compiler has to convert it to strings again .
<a href="link_page?variable=<%=sub_name%>><%=sub_name%></a>
becomes
out.println("<a href=");
out.println(variable);
.
.
.
This may gain you some performance, especially if it runs inside a long loop.