jsp include and jsp param

Discussion in 'Java' started by Robert Mark Bram, Sep 8, 2005.

  1. 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
    :)
     
    Robert Mark Bram, Sep 8, 2005
    #1
    1. Advertisements

  2. Robert Mark Bram

    Stalin Guest

    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?
     
    Stalin, Sep 9, 2005
    #2
    1. Advertisements

  3. 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
    :)
     
    Robert Mark Bram, Sep 12, 2005
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.