1 Reply Latest reply on Feb 24, 2011 6:38 AM by Gregory Nikle

    UrlRewrite and formu submi, help

    Gregory Nikle Apprentice

      Hi,
      I try to use url rewriting for pretty urls and i got problem with form submiting in seam...
      Here what I do:


      1. I use newest Seam 2.2.1.Final on Tomcat 6
      2. In components I've added



      <web:rewrite-filter view-mapping="*.seam" />



      3. In pages there is navigation rule.


          <page view-id="/register_game.xhtml" action="#{registerGameAction.register}">
                <rewrite pattern="/register_game" />
                
                <navigation from-action="#{registerGameAction.registerPlayer}"> 
                      <rule if-outcome="success"><redirect view-id="/registered.xhtml"/></rule>
                </navigation>          
          </page>



      4. In register game.xhtml I've got form.


      <h:form id="registerForm">
      <h:inputText value="#{registerGameAction.email}" maxlength="100" />
      <a4j:commandButton value="#{messages['button.register']}" action="#{registerGameAction.registerPlayer}" requestDelay="100" eventsQueue="requestQueue" reRender="registerForm" />
      </h:form>



      5. My bean class looks like


      @SimpleProfile
      @Scope(ScopeType.SESSION)
      @Name("registerGameAction")



      And here is my problem...
      1. I can navigate form main page to registration page, and url looks great



      /app/register game

      2. But when i submit form, fields are filled, but when form validation is not succed, then user is redirected back to my form and all fields which should be still filled, are cleaned.


      This looks like a bean sate .PAGE


      Can anyone explain me how to fix this problem?