4 Replies Latest reply on Feb 13, 2007 10:28 PM by Gavin King

    java.lang.IllegalArgumentException: page parameter may not b

    mike luu Newbie

      I am trying to do the following:
      1. from page content.xhtml, there is a link to edit the contents of that page

      <h:outputLink value="/edit/edit_content.seam">
       <f:param name="id" value="#{contentView.content.id}" />
       Edit Content
      </h:outputLink>
      


      2. i get redirected to edit/edit_content.seam to edit content

      3. there is a save button on the edit_content page defined with:

      <h:commandButton action="#{editView.saveAction}" value="Save">
       <f:param name="id" value="#{editView.id}" />
      </h:commandButton>
      


      4. when i click on the Save button, I get the IllegalArgumentException. IS THIS A BUG? IF NOT, HOW CAN I REDIRECT BACK TO content.xhtml WITH THE content id param? I have tried to set the outcome of saveAction to be "/content.xhtml?id=#{editView.id}", but i get the same result. i have tried to concat the content id explicitly, but that results in the same issue.

      I have the following pages.xml configuration:
      <page view-id="/content.xhtml" action="#{contentView.populate}">
       <param name="id" value="#{contentView.id}"/>
      </page>
      
       <page view-id="/edit/edit_content.xhtml" action="#{editView.populate}">
       <param name="id" value="#{editView.id}"/>
       <navigation from-action="#{editView.saveAction}">
       <rule if-outcome="success">
       <redirect view-id="/content.xhtml">
       <param name="id" value="#{editView.id}"/>
       </redirect>
       </rule>
       </navigation>
       </page>
      

      editView and contentView beans are PAGE scoped and javax.faces.DEFAULT_SUFFIX=.xhtml.


      Thanks for your help in advance!

        • 1. Re: java.lang.IllegalArgumentException: page parameter may n
          Gavin King Master

          Please don't write things like "is this a bug" in all caps. It is not a bug in this case, and I have never once in 5 years of involvement in user forums like hibernate.org or jboss.com, seen a single case where a user who claimed to have found a bug in all caps had actually found a bug.

          The h:commandButton control does not support f:param in JSF, so you should use s:button instead.

          • 2. Re: java.lang.IllegalArgumentException: page parameter may n
            mike luu Newbie

            my apologies, i didn't mean to emphasize that this is a bug, and in no way am i pointing fingers. sorry.

            to put it succinctly, i am trying to go from page A to page B back to page A. from page B, i am submitting a save via a command button and after saving the data, i would like to get back to page A displaying the content identified by id. the data is saved correctly, but i am trying to get back to page A.

            i will try to use the s:button per your suggestion.

            thanks!

            • 3. Re: IllegalArgumentException: page parameter may not be mult
              mike luu Newbie

              s:button results in the same exception.

              perhaps i would help if i included the entire stack trace. :)

              java.lang.IllegalArgumentException: page parameter may not be multi-valued: id
              at org.jboss.seam.pages.Param.getValueFromRequest(Param.java:129)
              at org.jboss.seam.core.Pages.applyRequestParameterValues(Pages.java:430)
              at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:176)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:57)
              at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
              at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
              :664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)

              • 4. Re: java.lang.IllegalArgumentException: page parameter may n
                Gavin King Master

                If you have declared a page parameter, you do *not* need to include it explicitly in links or buttons that link or submit to that page. It gets added automatically.