JSP - Passing Parameters Between JSP Pages

How to pass parameters between JSP pages using pure Java code?

those. I do not want to use the following codes:

<jsp:include page="<%=fileName%>" flush="true">
                        <jsp:param name="txtUsername" value="<%=_USERNAME_%>" />
                        <jsp:param name="txtName" value="<%=name%>" />
                        <jsp:param name="txtPassword" value="<%=_PASSWORD_%>" />
                </jsp:include>

I need pure Java code.

+3
source share
1 answer

What about:

<% request.setAttribute("foo", "bar"); %>
<jsp:include page="<%=fileName%>" flush="true" />

And the corresponding use in the included file:

<%= request.getAttribute("foo") %>
+6
source

Source: https://habr.com/ru/post/1712837/


All Articles