Click
  1. Click
  2. CLK-267

Exception During Duplicate Submition Security Check in Stateful Form

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      It looks looks like there may be a problem using the recommended strategy for handling duplicate form submissions

      public boolean onSecurityCheck()

      { return form.onSubmitCheck(this, "/invalid-submit.html"); }

      in stateful Forms.

      java.lang.IllegalArgumentException: Form already contains field named: SUBMIT_CHECK_/ui/htm/view-test-results.htm
      at net.sf.click.control.Form.add(Form.java:696)
      at net.sf.click.control.Form.performSubmitCheck(Form.java:2145)
      at net.sf.click.control.Form.onSubmitCheck(Form.java:1905)
      at com.dcredna.readi.ab.ui.htm.SingleFormPage.onSecurityCheck(SingleFormPage.java:99)
      at net.sf.click.ClickServlet.processPage(ClickServlet.java:564)
      at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:351)
      at net.sf.click.ClickServlet.doPost(ClickServlet.java:303)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:482)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
      at java.lang.Thread.run(Thread.java:595)

        Activity

        Hide
        Joel Schmidt added a comment -

        Oops. Let me clarify that. On a stateful Page with a Form on it.

        Show
        Joel Schmidt added a comment - Oops. Let me clarify that. On a stateful Page with a Form on it.
        Hide
        Bob Schellink added a comment -

        Seems that calling onSubmitCheck more than once does not work.

        The following test fails:

        Form form = new Form("form");

        //calling onSubmitCheck once will work
        form.onSubmitCheck(this, "/invalid-submit.html");

        //The following call fails with the above exception
        form.onSubmitCheck(this, "invalid-submit.html");

        performSubmitCheck just needs to check if there already exists a SUBMIT_CHECK field.

        Show
        Bob Schellink added a comment - Seems that calling onSubmitCheck more than once does not work. The following test fails: Form form = new Form("form"); //calling onSubmitCheck once will work form.onSubmitCheck(this, "/invalid-submit.html"); //The following call fails with the above exception form.onSubmitCheck(this, "invalid-submit.html"); performSubmitCheck just needs to check if there already exists a SUBMIT_CHECK field.
        Hide
        Bob Schellink added a comment -

        Hi Malcolm

        When you have time can you review this patch please.

        Thanks

        Show
        Bob Schellink added a comment - Hi Malcolm When you have time can you review this patch please. Thanks
        Hide
        Malcolm Edgar added a comment -

        Hi Bob,

        Patch looks fine to me please submit this.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - Hi Bob, Patch looks fine to me please submit this. regards Malcolm
        Hide
        Bob Schellink added a comment -

        fix for 1.4RC3 checked in

        Show
        Bob Schellink added a comment - fix for 1.4RC3 checked in

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Joel Schmidt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development