Возможно ли это сделать? Я хочу передать пользователя сервлету:
@WebServlet("/profile")
, чтобы URL был таким: /profile?username=currentusername
Я пытался:
<%
HttpSession session1 = request.getSession(false);
String username = (String) session1.getAttribute("username");
%>
<div class="navbar-item"
onclick="location.href =
'${pageContext.request.contextPath}/profile?username=${requestScope.username}'
My profile
</div>
Но это не работает.