Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer doIndex over index views #101

Merged
merged 7 commits into from
Jan 18, 2017
Merged

Prefer doIndex over index views #101

merged 7 commits into from
Jan 18, 2017

Commits on Jan 15, 2017

  1. index view handling should be in dispatcher

    For uniformity and to precisely control its priority, this logic should
    be a regular Dispatcher, not a hard-coded part of Stapler.tryInvoke()
    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    1dcacea View commit details
    Browse the repository at this point in the history
  2. HttpDeletable processing should be a Dispatcher

    This way code is more modular
    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    21756da View commit details
    Browse the repository at this point in the history
  3. Move '/' appending logic to Dispatcher

    ... for better modularity.
    
    In the future we should allow this behaviour to be modified by the
    class, for example via annotation. Some API bound objects like Jenkins
    Blue Ocean would prefer not to have this behaviour.
    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    64e78f4 View commit details
    Browse the repository at this point in the history
  4. fixup

    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    b063795 View commit details
    Browse the repository at this point in the history
  5. Turn anonymous class into a named class

    So that the buildDispatchers method look a little manageable
    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    2a48247 View commit details
    Browse the repository at this point in the history
  6. Switch ordering between index.jelly vs doIndex

    Currently the code performs index view lookup before doIndex handling.
    This behaviour is inconsistent with the relative ordering between
    xyz.jelly vs doXyz where the latter wins. This behaviour is considered
    sensible because it'd allow programmatic check before a view is
    rendered by using StaplerRequest.getView().
    
    The code also has a performance improvement effect for those model
    objects that do not define any index view but doIndex, by going straight
    to doIndex without bothering to try index views. Objects that do define
    index view without doIndex will perform the same, because the presence
    of doIndex is tested during MetaClass.buildDispatchers(), and not during
    dispatching requests.
    
    See: #97
    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    8156216 View commit details
    Browse the repository at this point in the history
  7. Updated test

    A non-null ServletContext is needed to build MetaClass
    kohsuke committed Jan 15, 2017
    Configuration menu
    Copy the full SHA
    137c8e6 View commit details
    Browse the repository at this point in the history