MJ
asked on
Pass dynamic variable to include????
I want to pass a parameter to an include:
<%
String stage = request.getParameter("prim aryComp");
%>
<jsp:include page="test.jsp?stage=<%=st age%>" flush="true"/>
/////////////////////
but this doesn't work? Any ideas?? The parameter is being passed in.
<%
String stage = request.getParameter("prim
%>
<jsp:include page="test.jsp?stage=<%=st
/////////////////////
but this doesn't work? Any ideas?? The parameter is being passed in.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So it's coming up null even with a literal (as above)?
ASKER
That's correct!
Hmm, not sure why. I'm clocking off now, but objects will be able to help out (soonish probably)
ASKER
I figured out why I was having problems, for some reason, I had to remove the "/" in the include call:
<jsp:include page="test.jsp" flush="true">
<jsp:param name="stage" value="<%=stage%>"/>
</jsp:include>
<jsp:include page="test.jsp" flush="true">
<jsp:param name="stage" value="<%=stage%>"/>
</jsp:include>
:-)
Hmm. Can you please post the code that's now working?
Hmm. Can you please post the code that's now working?
ASKER
<jsp:include page="test.jsp" flush="true">
<jsp:param name="stage" value="<%=stage%>"/>
</jsp:include>
:)
<jsp:param name="stage" value="<%=stage%>"/>
</jsp:include>
:)
ASKER
<jsp:include page="test.jsp" flush="true"/>
<jsp:param name="stage" value="red"/>
</jsp:include>
And it comes up null in the include???
Here's how I'm calling it in the include:
String stage = request.getParameter("stag