Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1173

@BeanParam JavaBeans do not support @Inject constructor injection

XMLWordPrintable

    • User Experience

      I would like to take advantage of constructor based dependency injection for my @BeanParam objects, however the following does not work. I'm using guice for dependency injection but I'm fairly confident that CDI also would not work since Bean Parameters require a no-arg constructor in org.jboss.resteasy.core.FormInjector.

      class RequestParams {
      
         private final ReusableRequestParser parser;
         private final int id;
      
         @Inject
         RequestParams(final ReusableRequestParser parser, @QueryParam("id") int id) {
          this.parser = parser;
          this.id = id;
        }
      
         ...
      }
      

              rsigal@redhat.com Ronald Sigal
              matthew.madson_jira Matthew Madson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: