Tapestry
  1. Tapestry
  2. TAPESTRY-1605

The request encoding (for component action requests) occurs too late; after query parameters of the request have been accessed, which prevents the proper request encoding from being used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.11
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Due to changeset 550147 that fix issue "tapestry-1294",

      request.setCharacterEncoding is not working in case of form submit data event
      because of method request.setEncoding in RequestEncodingInitializerImpl is called after
      request.getParameter(InternalConstants.PAGE_CONTEXT_NAME) in ComponentActionDispatcher.

        Issue Links

          Activity

          polawat phetra created issue -
          polawat phetra made changes -
          Field Original Value New Value
          Link This issue is related to TAPESTRY-1294 [ TAPESTRY-1294 ]
          Howard M. Lewis Ship made changes -
          Assignee Howard M. Lewis Ship [ hlship ]
          Howard M. Lewis Ship made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Howard M. Lewis Ship made changes -
          Summary request.setEncoding in RequestEncodingInitializerImpl has no effect on 'form submit event'. The request encoding (for component action requests) occurs too late; after query parameters of the request have been accessed, which prevents the proper request encoding from being used
          Hide
          Howard M. Lewis Ship added a comment -

          In the use case where an action is for a page off of the active page, the page name in the URL will now be the active page (so that the request encoding can be determined) and a query parameter will be used to store the containing page.

          Show
          Howard M. Lewis Ship added a comment - In the use case where an action is for a page off of the active page, the page name in the URL will now be the active page (so that the request encoding can be determined) and a query parameter will be used to store the containing page.
          Howard M. Lewis Ship made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          Fix Version/s 5.0.11 [ 12312968 ]
          Hide
          polawat phetra added a comment -

          I have test your solution and find a new issue.
          This is a stack trace that show the problem.

          The HttpServletRequest object is access by ClientPersistentFieldStrategy with activate by PageImpl.attached()

          (revision 632972)
          ======================================================
          RequestImpl.getParameter(String) line: 56 <<+++++++ ACCESS REQUEST PARAMETER ++++++++>>
          ...
          ClientPersistentFieldStorageImpl.<init>(Request) line: 120
          ...
          NativeConstructorAccessorImpl.newInstance(Object[]) line: 39
          DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27
          Constructor<T>.newInstance(Object...) line: 494
          ConstructorServiceCreator.createObject() line: 51
          PerThreadServiceCreator.createObject() line: 53
          ...
          ClientPersistentFieldStrategy.gatherFieldChanges(String) line: 39
          ...
          PersistentFieldManagerImpl.gatherChanges(String) line: 65
          ...
          PageImpl.getFieldChange(String, String) line: 171
          InternalComponentResourcesImpl.getFieldChange(String) line: 105
          InternalComponentResourcesImpl.hasFieldChange(String) line: 115
          Form.containingPageDidAttach() line: not available
          ComponentPageElementImpl$2.run(Component) line: 71
          ComponentPageElementImpl.invoke(boolean, ComponentCallback) line: 880
          ComponentPageElementImpl.containingPageDidAttach() line: 706
          PageImpl.attached() line: 146
          RequestPageCacheImpl.get(String) line: 45
          ...
          RequestEncodingInitializerImpl.initializeRequestEncoding(String) line: 41 <<-++++++ HERE 's a PROBLEM
          ...
          ComponentEventDispatcher.dispatch(Request, Response) line: 119
          ...
          TapestryModule$13.service(Request, Response) line: 928
          AppModule$1.service(Request, Response, RequestHandler) line: 57
          ...
          LocalizationFilter.service(Request, Response, RequestHandler) line: 42
          ...
          TapestryModule$3.service(Request, Response, RequestHandler) line: 539
          ======================================================

          I think that the best solution is just use ServletFilter or RequestFilter to set the character encoding.

          Show
          polawat phetra added a comment - I have test your solution and find a new issue. This is a stack trace that show the problem. The HttpServletRequest object is access by ClientPersistentFieldStrategy with activate by PageImpl.attached() (revision 632972) ====================================================== RequestImpl.getParameter(String) line: 56 <<+++++++ ACCESS REQUEST PARAMETER ++++++++>> ... ClientPersistentFieldStorageImpl.<init>(Request) line: 120 ... NativeConstructorAccessorImpl.newInstance(Object[]) line: 39 DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27 Constructor<T>.newInstance(Object...) line: 494 ConstructorServiceCreator.createObject() line: 51 PerThreadServiceCreator.createObject() line: 53 ... ClientPersistentFieldStrategy.gatherFieldChanges(String) line: 39 ... PersistentFieldManagerImpl.gatherChanges(String) line: 65 ... PageImpl.getFieldChange(String, String) line: 171 InternalComponentResourcesImpl.getFieldChange(String) line: 105 InternalComponentResourcesImpl.hasFieldChange(String) line: 115 Form.containingPageDidAttach() line: not available ComponentPageElementImpl$2.run(Component) line: 71 ComponentPageElementImpl.invoke(boolean, ComponentCallback) line: 880 ComponentPageElementImpl.containingPageDidAttach() line: 706 PageImpl.attached() line: 146 RequestPageCacheImpl.get(String) line: 45 ... RequestEncodingInitializerImpl.initializeRequestEncoding(String) line: 41 <<-++++++ HERE 's a PROBLEM ... ComponentEventDispatcher.dispatch(Request, Response) line: 119 ... TapestryModule$13.service(Request, Response) line: 928 AppModule$1.service(Request, Response, RequestHandler) line: 57 ... LocalizationFilter.service(Request, Response, RequestHandler) line: 42 ... TapestryModule$3.service(Request, Response, RequestHandler) line: 539 ====================================================== I think that the best solution is just use ServletFilter or RequestFilter to set the character encoding.
          Mark Thomas made changes -
          Workflow jira [ 12407122 ] Default workflow, editable Closed status [ 12568597 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12568597 ] jira [ 12590078 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          249d 21h 1m 1 Howard M. Lewis Ship 02/Mar/08 22:38
          In Progress In Progress Closed Closed
          34m 47s 1 Howard M. Lewis Ship 02/Mar/08 23:13

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              polawat phetra
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development