How can I add parameters to a link in a jsp without overwriting what is already there?
For example I have this now:
<a href="<c:url value='/Top.jsp?sortBy=downloads&sortOrder=desc'/>">
But if they have a search term in there (or whatever) already I don’t want to lose the other parameters when I sort. How do I go about that? Do I have to use <% request.getUrl %> or something like that?
Use
HttpServletRequest#getQueryString().