Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-4717

s:token NPE occurs when double submit performed

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.0.GA
    • Fix Version/s: None
    • Component/s: JSF Controls
    • Labels:
      None
    • Environment:

      JBOSS 5.1.0.GA JETTY 6.1.25 Seam 2.2.0.GA + Sun RI JSF 1.2_13
      server side state saving (default) enabled

    • Steps to Reproduce:
      Hide

      1. Create test.xhml view which contains following form definition:

      <h:form>
      <s:token/>
      <h:inputText id="name" value="#

      {test.name}

      " />
      <h:commandButton value="Submit" action="/page/test1.seam" />
      </h:form>

      2. Create test1.xhtml view (used to navigate from test.xhtml)

      3. Open test.xhtml view in browser (IE, Firefox etc.)

      4. Press form submit button, test1.xhtml should be opened in browser

      5. Press browser's BACK button, test.view should be displayed in browser

      6. Press submit button once again (this is a double submit)

      7. NPE is raised (seam debug page is opened)

      Test views are attached to the defect.

      Show
      1. Create test.xhml view which contains following form definition: <h:form> <s:token/> <h:inputText id="name" value="# {test.name} " /> <h:commandButton value="Submit" action="/page/test1.seam" /> </h:form> 2. Create test1.xhtml view (used to navigate from test.xhtml) 3. Open test.xhtml view in browser (IE, Firefox etc.) 4. Press form submit button, test1.xhtml should be opened in browser 5. Press browser's BACK button, test.view should be displayed in browser 6. Press submit button once again (this is a double submit) 7. NPE is raised (seam debug page is opened) Test views are attached to the defect.

      Description

      NPE raised during double submit when use s:token

      Caused by java.lang.NullPointerException with message: ""

      org.jboss.seam.ui.renderkit.TokenRendererBase.generateViewSignature(TokenRendererBase.java:177)
      org.jboss.seam.ui.renderkit.TokenRendererBase.doDecode(TokenRendererBase.java:108)
      org.jboss.seam.ui.util.cdk.RendererBase.decode(RendererBase.java:59)
      javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
      javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1031)
      javax.faces.component.UIForm.processDecodes(UIForm.java:209)
      org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:400)

      line 177
      String renderStamp = form.getAttributes().get(RENDER_STAMP_ATTR).toString();

      RENDER_STAMP_ATTR is removed during first form submit.
      When you submit the same form second time NPE is raised becuse attribute is not in the map anymore.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                udavz Valeriy Molyakov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: