MyFaces Core
  1. MyFaces Core
  2. MYFACES-244

jsp:param for subviews works in the RI but not in MyFaces

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.1.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      tomcat 5.0.28, myfaces 1.1.5

      Description

      In the myFaces implementation you can't pass parameters to subviews but you can in the Ref. Impl.

      ------------------------------------------------------------
      <!-- welcome.jsp -->
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>

      <html>
      <head>
      <title>Welcome!</title>
      </head>
      <body>
      <f:view>
      <h:form>

      Hello, this is content from the calling page.

      <f:subview id="mySubviewPage">
      <jsp:include page="mySubviewPage.jsp" flush="true">
      <jsp:param name="parameterXXX" value="The value of parameter XXX is this string."/>
      </jsp:include>
      </f:subview>

      </h:form>
      </f:view>
      </body>
      </html>

      ------------------------------------------------------------
      <!-- mySubviewPage.jsp -->
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>

      <f:subview id="headerSubview">

      <f:verbatim>
      <p>This is mySubviewPage content.</p>
      </f:verbatim>

      <Unable to render embedded object: File (-- This doesn't work in myFaces but does in the RI) not found.!! -->
      <h:outputText value="#

      {param.parameterXXX}

      "/>

      </f:subview>

        Activity

        Hide
        Pino Silvaggio added a comment -

        Well, I tried this and it seems to work for me.
        Don't see any problems.

        Show
        Pino Silvaggio added a comment - Well, I tried this and it seems to work for me. Don't see any problems.
        Hide
        Martin Marinschek added a comment -

        As one of our users has tried this and it seems to work, I close that - we can always reopen it with a better test-case

        Show
        Martin Marinschek added a comment - As one of our users has tried this and it seems to work, I close that - we can always reopen it with a better test-case
        Hide
        Stephen Cooper added a comment -

        I'm able to recreate this issue - it's going to cause us a fair amount of issues very quickly.

        <%-- index.jsp --%>
        <%@ page language="java" pageEncoding="ISO-8859-1"%>
        <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
        <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
        <f:view>
        <h:panelGrid columns="1">
        <h:outputText value="This is my JSP page."/>
        </h:panelGrid>
        <f:subview id="subpage">
        <jsp:include flush="true" page="subpage.jsp">
        <jsp:param name="test" value="Hello world!"/>
        </jsp:include>
        </f:subview>
        </f:view>

        <%-- subpage.jsp --%>
        <%@ page language="java" pageEncoding="ISO-8859-1"%>
        <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
        <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
        <h:panelGrid columns="1">
        <h:outputText value="We should see text below here"/>
        <h:outputText value="#

        {param.test}

        "></h:outputText>
        <h:outputText value="We should see text above here"/>
        </h:panelGrid>

        This displays the following with the RI:
        This is my JSP page.
        We should see text below here
        Hello world!
        We should see text above here

        and the following with MyFaces 1.1.5:
        This is my JSP page.
        We should see text below here

        We should see text above here

        Show
        Stephen Cooper added a comment - I'm able to recreate this issue - it's going to cause us a fair amount of issues very quickly. <%-- index.jsp --%> <%@ page language="java" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <f:view> <h:panelGrid columns="1"> <h:outputText value="This is my JSP page."/> </h:panelGrid> <f:subview id="subpage"> <jsp:include flush="true" page="subpage.jsp"> <jsp:param name="test" value="Hello world!"/> </jsp:include> </f:subview> </f:view> <%-- subpage.jsp --%> <%@ page language="java" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <h:panelGrid columns="1"> <h:outputText value="We should see text below here"/> <h:outputText value="# {param.test} "></h:outputText> <h:outputText value="We should see text above here"/> </h:panelGrid> This displays the following with the RI: This is my JSP page. We should see text below here Hello world! We should see text above here and the following with MyFaces 1.1.5: This is my JSP page. We should see text below here We should see text above here
        Hide
        Stephen Cooper added a comment -

        I can't re-open this bug (probably by design). Please re-open.

        Show
        Stephen Cooper added a comment - I can't re-open this bug (probably by design). Please re-open.
        Hide
        LeRoy Mattingly added a comment -

        I'm reopening per Stephen Cooper's request.

        Show
        LeRoy Mattingly added a comment - I'm reopening per Stephen Cooper's request.
        Hide
        nikolaos georgosoulos added a comment -

        I just found out that in the RI it only works when the jsp:include is not inside an h:panelGrid. PanelGrid seam to be causing problems anyway. Yet, in myfaces impl. the problem exists even without the panelgrid

        Show
        nikolaos georgosoulos added a comment - I just found out that in the RI it only works when the jsp:include is not inside an h:panelGrid. PanelGrid seam to be causing problems anyway. Yet, in myfaces impl. the problem exists even without the panelgrid

          People

          • Assignee:
            Martin Marinschek
            Reporter:
            LeRoy Mattingly
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development