Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2792

Redirect with include-view-params in faces-config.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.1
    • None
    • None

    Description

      I have a bean

      @ManagedBean(name="blog")
      @SessionScoped
      public class Blog {

      private String content;

      private static AtomicInteger id = new AtomicInteger(0);

      private String idm;

      public String addBlog()

      { this.idm = Integer.toString(id.incrementAndGet()); return "view?faces-redirect=true&includeViewParams=true"; }

      }

      This is result view
      <h:body>

      <f:view>
      <f:metadata>
      <f:viewParam name="id" value="#

      {blog.idm}

      "></f:viewParam>
      </f:metadata>
      </f:view>

      <h:outputText value="#

      {blog.content}

      "></h:outputText>

      </h:body>

      This works! Changed to following and adding faces-config.xml
      public String addBlog()

      { this.idm = Integer.toString(id.incrementAndGet()); return "ok"; }

      <navigation-rule>

      <navigation-case>
      <from-action>#

      {blog.addBlog}

      </from-action>
      <from-outcome>ok</from-outcome>
      <to-view-id>/view.xhtml</to-view-id>
      <redirect include-view-params="true"/>
      </navigation-case>

      </navigation-rule>

      Not working!

      What can be the problem? (I think doing some wrong actions!)

      Attachments

        Activity

          People

            jakobkorherr Jakob Korherr
            gerdogdu Gurkan Erdogdu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: