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

Guice integration doesn't honour optional bindings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.4-RC4
    • wicket-guice
    • 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

        1. 0002-Guice-integration-doesn-t-honour-optional-bindings.patch
          1 kB
          Guðmundur Bjarni Ólafsson
        2. 0001-WICKET-2241-Support-for-Guice-s-Inject-optional.patch
          9 kB
          Guðmundur Bjarni Ólafsson

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: