This is my part of jsp file.i am struggling to set param value to SalesClientDetails.jsp.i am not using this style <% %>. How to pass param i tried using jsp:expression but no success.
<jsp:scriptlet>
if (request.getParameter("clientid") != null) {
String clientid = request.getParameter("clientid");
</jsp:scriptlet>
<jsp:include page="SalesClientDetails.jsp">
<jsp:param name="clientid" value= />
</jsp:include>
<jsp:scriptlet>
}
</jsp:scriptlet>
Simple, do not use scriptlets, also not in flavor of JSP tags. Use JSTL/EL.
<c:if test="${not empty param.clientid}">
<jsp:include page="SalesClientDetails.jsp" />
</c:if>
And in the SalesClientDetails.jsp
just get it by
${param.clientid}
You've created the variable clientId
within a scriptlet, which means that it's a Java variable (versus a value in the page context). So you have to retrieve it with <%= %>
:
<jsp:param name="clientid" value="<%=clientId%>" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With