Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-12027

DefaultValue annotation values are not taken into account in JAX-RS REST Web Services explorer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.30.x
    • 3.3.0.CR1
    • webservices
    • Hide

      STEP: Create dynamic web project with JAX-RS support
      STEP: Create JAX-RS web service:

      Service.java
      @GET
      @Path("/{param1}")
      public void method(@PathParam("param1") @DefaultValue("default1") String param1, 
      	           @MatrixParam("param2") @DefaultValue("default2") String param2,
      		   @QueryParam("param3") @DefaultValue("default3") String param3) {
          
      }
      

      STEP: Click on context menu (Run As -> Run on Server) of this GET method in JAX-RS explorer, Web Service Tester view should be visible now
      STEP: Click Invoke Button
      ASSERT: default values for all parameters have been set
      FAIL: default value only for @QueryParam param3 has been set

      Show
      STEP: Create dynamic web project with JAX-RS support STEP: Create JAX-RS web service: Service.java @GET @Path( "/{param1}" ) public void method(@PathParam( "param1" ) @DefaultValue( "default1" ) String param1, @MatrixParam( "param2" ) @DefaultValue( "default2" ) String param2, @QueryParam( "param3" ) @DefaultValue( "default3" ) String param3) { } STEP: Click on context menu (Run As -> Run on Server) of this GET method in JAX-RS explorer, Web Service Tester view should be visible now STEP: Click Invoke Button ASSERT: default values for all parameters have been set FAIL: default value only for @QueryParam param3 has been set
    • ?

      I tried using @DefaultValue with @QueryParam, @MatrixParam and @PathParam. Only when using with @QueryParam, URL in JAX-RS explorer is computed correctly.

            Unassigned Unassigned
            jjankovi Jaroslav Jankovič (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: