Wicket
  1. Wicket
  2. WICKET-4780

Using both MountedMapper and CryptoMapper causes warning

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7, 6.0.0
    • Fix Version/s: 6.1.0, 1.5.9
    • Component/s: wicket
    • Labels:
      None

      Description

      Having both MountedMapper and CryptoMapper causes:
      WARN - WebPageRenderer - The Buffered response should be handled by BufferedResponseRequestHandler

      	public void init() {
      		setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
      		mountPage("/home", HomePage.class);
      		super.init();
      	}
      
      	public HomePage(final PageParameters parameters) {
      		super(parameters);
      
      		add(new Label("version", getApplication().getFrameworkSettings().getVersion()));
      
      		add(new Form<Void>("form"));
      	}
      
      --HomePage.html
      ...
      <form wicket:id="form"></form>
      ...
      

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          Hi Matthias,

          Yes, you still should be able to do this.
          The attached quickstart does exactly this.

          Show
          Martin Grigorov added a comment - Hi Matthias, Yes, you still should be able to do this. The attached quickstart does exactly this.
          Hide
          Matthias Keller added a comment -

          @Martin: Does your fix mean, the CryptoMapper can still be added first, followed by a number of mountPage() calls?
          We have the situation that most of our app should be encrypted, but there are several URLs called directly from the outside with a special meaning that need to be available under this URL and will not support an immediate redirect to another url (especially since some URLs are the target of a direct initial POST request)?

          Show
          Matthias Keller added a comment - @Martin: Does your fix mean, the CryptoMapper can still be added first, followed by a number of mountPage() calls? We have the situation that most of our app should be encrypted, but there are several URLs called directly from the outside with a special meaning that need to be available under this URL and will not support an immediate redirect to another url (especially since some URLs are the target of a direct initial POST request)?
          Hide
          Kurtulus Avcibasi added a comment -

          1- To be honest I would avoid MountedMapper but that causes another problem (which I dont have too much details to represent atm).
          When I enable CryptoMapper the URL's in my custom behaviours go invalid thats why I chose mounting the pages I use those behaviours.
          2- BookmarkableCryptoMapper given in WICKET-4140 is incomplete I assume since when I use it the resources (again URL problem) go haywire.

          Show
          Kurtulus Avcibasi added a comment - 1- To be honest I would avoid MountedMapper but that causes another problem (which I dont have too much details to represent atm). When I enable CryptoMapper the URL's in my custom behaviours go invalid thats why I chose mounting the pages I use those behaviours. 2- BookmarkableCryptoMapper given in WICKET-4140 is incomplete I assume since when I use it the resources (again URL problem) go haywire.
          Martin Grigorov made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Martin Grigorov [ mgrigorov ]
          Fix Version/s 6.1.0 [ 12322957 ]
          Fix Version/s 1.5.9 [ 12322962 ]
          Resolution Fixed [ 1 ]
          Hide
          Martin Grigorov added a comment -

          Fixed by delegating CryptoMapper#getCompatibilityScore() to the wrapped ex-root request mapper.

          Show
          Martin Grigorov added a comment - Fixed by delegating CryptoMapper#getCompatibilityScore() to the wrapped ex-root request mapper.
          Martin Grigorov made changes -
          Remote Link This issue links to "Discussion at dev@ (Web Link)" [ 11155 ]
          Hide
          Martin Grigorov added a comment -

          It seems the current behavior is as designed. See http://markmail.org/thread/b2zxg7w3i75anadl
          If you want to keep mounted paths not encrypted then you can use BookmarkableCryptoMapper.java from https://issues.apache.org/jira/browse/WICKET-4140.

          I'll leave the ticket open for a while if someone wants to implement the improvement I suggested in this mail thread.

          Show
          Martin Grigorov added a comment - It seems the current behavior is as designed. See http://markmail.org/thread/b2zxg7w3i75anadl If you want to keep mounted paths not encrypted then you can use BookmarkableCryptoMapper.java from https://issues.apache.org/jira/browse/WICKET-4140 . I'll leave the ticket open for a while if someone wants to implement the improvement I suggested in this mail thread.
          Hide
          Martin Grigorov added a comment -

          The problem here is that BufferedResponseMapper is wrapped as part of SystemMapper in CryptoMapper.
          Later when mountPage("/home") is called a new CompoundRequestMapper is created with CryptoMapper as an member and a MountedMapper for HomePage is prepended to it.
          So we have : CompoundRequestMapper(MountedMapper(/home), CryptoMapper(SystemMapper(BufferedResponseMapper, /* other system mappers */ )))

          When a request with url : home?0 comes MountedMapper(/home) matches on it and BufferedResponseMapper is not asked at all. Later when starting to render the reported WARN is issued because now we check for stored response.

          Show
          Martin Grigorov added a comment - The problem here is that BufferedResponseMapper is wrapped as part of SystemMapper in CryptoMapper. Later when mountPage("/home") is called a new CompoundRequestMapper is created with CryptoMapper as an member and a MountedMapper for HomePage is prepended to it. So we have : CompoundRequestMapper(MountedMapper(/home), CryptoMapper(SystemMapper(BufferedResponseMapper, /* other system mappers */ ))) When a request with url : home?0 comes MountedMapper(/home) matches on it and BufferedResponseMapper is not asked at all. Later when starting to render the reported WARN is issued because now we check for stored response.
          Martin Grigorov made changes -
          Priority Trivial [ 5 ] Major [ 3 ]
          Kurtulus Avcibasi made changes -
          Field Original Value New Value
          Attachment WICKET-4780_quickstart.rar [ 12546295 ]
          Kurtulus Avcibasi created issue -

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Kurtulus Avcibasi
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development