jsp include and jsp param

  • Thread starter Robert Mark Bram
  • Start date
R

Robert Mark Bram

Hi All,

I have the following:

<jsp:include page="anotherPage.jsp">
<jsp:param name="portletResponse" value="sdfasdfsd"/>
</jsp:include>



And in anotherPage.jsp I have:

<%@ taglib uri="/WEB-INF/tld/commons-log.tld" prefix="log" %>
<log:dump scope="request"/>
<log:dump scope="session"/>
<log:dump scope="page"/>
<log:dump scope="application"/>
<h3>
Test: <%= request.getParameter("testing") %>
</h3>



Not only does this output:
Test: null

but I don't see 'testing' anywhere in the dumps! What is going wrong?
Have I badly misunderstood parameter sending? :-/

Any assistance would be most appreciated!

Rob
:)
 
S

Stalin

Robert Mark Bram said:
Hi All,

I have the following:

<jsp:include page="anotherPage.jsp">
<jsp:param name="portletResponse" value="sdfasdfsd"/>
</jsp:include>



And in anotherPage.jsp I have:

<%@ taglib uri="/WEB-INF/tld/commons-log.tld" prefix="log" %>
<log:dump scope="request"/>
<log:dump scope="session"/>
<log:dump scope="page"/>
<log:dump scope="application"/>
<h3>
Test: <%= request.getParameter("testing") %>
</h3>
Are u sure that's complete jsp?
request.getParameter("testing") this will look for parameter "testing"
in the request (doesn't matter doGet( ) or doPost( )) since it doesn't find
it - > it prints null.
This is either incomplete jsp, otherwise tell me how do you put
"testing" in the request?
 
R

Robert Mark Bram

Hi Stalin,

==
request.getParameter("testing") this will look for parameter "testing"
==

Actually, my assumption was that this code puts the "testing" variable
in.. I pasted the wrong code in though - below is the correct one I
tested with:

<jsp:include page="anotherPage.jsp">
<jsp:param name="testing" value="sdfasdfsd"/>
</jsp:include>

Then my question becomes 1) where does jsp:param put the data items it
passes through and 2) if the data item didn't previously exist as a
request parameter, does it ignore it?

Rob
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top