Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2241

Guice integration doesn't honour optional bindings

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4-RC4
    • Component/s: wicket-guice
    • Labels:
      None

      Description

      When @Inject(optional=true) is applied and the binding isn't available, wicket should skip the injection silently.
      http://groups.google.com/group/google-guice/browse_thread/thread/2abe9b55ee26a198

      To check whether the binding is available, you need to use a try/catch block:
      try

      { Binding binding = injector.getBinding(key); // use the binding }

      catch (ConfigurationException e)

      { // the binding isn't available }

        Attachments

          Activity

            People

            • Assignee:
              ivaynberg Igor Vaynberg
              Reporter:
              jessewilson Jesse Wilson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: