[JBoss JIRA] (WFLY-10319) NameBinding annotations on resources are ignored in subresources
by Javier Estevez Sanchez (Jira)
[ https://issues.jboss.org/browse/WFLY-10319?page=com.atlassian.jira.plugin... ]
Javier Estevez Sanchez commented on WFLY-10319:
-----------------------------------------------
Hello Marek,
Thanks for your reply. JAX-RS 2.0 spec, section §3.4.1 reads:
{quote}
Methods of a resource class that are annotated with @Path are either sub-resource methods or sub-resource locators.
{quote}
The way I understand this is that sub-resource locators, despite not being annotated with a request method designator, are considered resource methods (unless a method of a resource is not the same as a resource method; that would be indeed confusing).
> NameBinding annotations on resources are ignored in subresources
> ----------------------------------------------------------------
>
> Key: WFLY-10319
> URL: https://issues.jboss.org/browse/WFLY-10319
> Project: WildFly
> Issue Type: Bug
> Components: REST
> Affects Versions: 12.0.0.Final
> Reporter: Javier Estevez Sanchez
> Assignee: Alessio Soldano
> Priority: Major
>
> The following JAX-RS resource exposes two resources via a GET operation: /demo and /demo/subresource. The first one via a sub-resource method, the latter via a sub-resource locator. Additionally, a response filter is binded to the JAX-RS resource class to modify the response. From the JAX-RS 2.0 spec, §6.5.2 Name Binding:
> {quote}
> Binding annotations that decorate resource classes apply to all resource methods defined in them.
> {quote}
> However, the binding annotation is not applying to the sub-resource locator method. This happens when the name binding annotation is on the resource class or on the sub-resource locator method. Annotating the sub-resource class or the method within works as expected, though.
> Below is the code needed to reproduce this issue:
> {code:java|title=The resource and subresource}
> @DemoNameBinding
> @Produces(MediaType.APPLICATION_JSON)
> @Path("/demo")
> public class DemoResource {
> @GET
> public String getDemoValue() {
> return "A value";
> }
> @Path("/subresource")
> public DemoSubResource getSubResource() {
> return new DemoSubResource();
> }
> public class DemoSubResource {
> @GET
> public String getDemoValue() {
> return "A value";
> }
> }
> }
> {code}
> {code:java|title=The filter}
> @Provider
> @DemoNameBinding
> public class SomeFilter implements ContainerResponseFilter {
> @Override
> public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {
> responseContext.setEntity("A filtered value");
> }
> }
> {code}
> {code:java|title=The binding}
> @NameBinding
> @Target({ElementType.TYPE, ElementType.METHOD})
> @Retention(RetentionPolicy.RUNTIME)
> public @interface DemoNameBinding {
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months
[JBoss JIRA] (WFLY-10319) NameBinding annotations on resources are ignored in subresources
by Marek Kopecký (Jira)
[ https://issues.jboss.org/browse/WFLY-10319?page=com.atlassian.jira.plugin... ]
Marek Kopecký commented on WFLY-10319:
--------------------------------------
I'm looking to the spec:
Chapter 3.3 - Resource Methods:
{quote}
Resource methods are methods of a resource class annotated with a request method designator.
...
A request method designator is a runtime annotation that is annotated with the @HttpMethod annotation. JAX-RS defines a set of request method designators for the common HTTP methods: @GET , @POST , @PUT , @DELETE , @PATCH , @HEAD and @OPTIONS .
{quote}
Chapter 6.5.2 - Name Binding:
{quote}
Binding annotations that decorate resource classes apply to all resource methods defined in them.
{quote}
And I'm looking to the example in the description of this jira. In that example, getSubResource method is not a Resource Method (based on previous definition, because this method doesn't have request method designator), so it should not be handled by SomeFilter.
The same behaviour has Payara5 with Jersey (reference implementation of jax-rs).
[~ron_sigal], [~asoldano]: This said, I suggest to close this jira as rejected.
> NameBinding annotations on resources are ignored in subresources
> ----------------------------------------------------------------
>
> Key: WFLY-10319
> URL: https://issues.jboss.org/browse/WFLY-10319
> Project: WildFly
> Issue Type: Bug
> Components: REST
> Affects Versions: 12.0.0.Final
> Reporter: Javier Estevez Sanchez
> Assignee: Alessio Soldano
> Priority: Major
>
> The following JAX-RS resource exposes two resources via a GET operation: /demo and /demo/subresource. The first one via a sub-resource method, the latter via a sub-resource locator. Additionally, a response filter is binded to the JAX-RS resource class to modify the response. From the JAX-RS 2.0 spec, §6.5.2 Name Binding:
> {quote}
> Binding annotations that decorate resource classes apply to all resource methods defined in them.
> {quote}
> However, the binding annotation is not applying to the sub-resource locator method. This happens when the name binding annotation is on the resource class or on the sub-resource locator method. Annotating the sub-resource class or the method within works as expected, though.
> Below is the code needed to reproduce this issue:
> {code:java|title=The resource and subresource}
> @DemoNameBinding
> @Produces(MediaType.APPLICATION_JSON)
> @Path("/demo")
> public class DemoResource {
> @GET
> public String getDemoValue() {
> return "A value";
> }
> @Path("/subresource")
> public DemoSubResource getSubResource() {
> return new DemoSubResource();
> }
> public class DemoSubResource {
> @GET
> public String getDemoValue() {
> return "A value";
> }
> }
> }
> {code}
> {code:java|title=The filter}
> @Provider
> @DemoNameBinding
> public class SomeFilter implements ContainerResponseFilter {
> @Override
> public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {
> responseContext.setEntity("A filtered value");
> }
> }
> {code}
> {code:java|title=The binding}
> @NameBinding
> @Target({ElementType.TYPE, ElementType.METHOD})
> @Retention(RetentionPolicy.RUNTIME)
> public @interface DemoNameBinding {
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months
[JBoss JIRA] (DROOLS-3454) Data type constraints: Day/Time Duration
by Liz Clayton (Jira)
[ https://issues.jboss.org/browse/DROOLS-3454?page=com.atlassian.jira.plugi... ]
Liz Clayton commented on DROOLS-3454:
-------------------------------------
[~karreiro] Here's a first pass revised mock for Enumeration. I couldn't fit the field labels after the input boxes, so needed to move them below, which included the row height. Not sure if that'll be okay for you? Also trying out different hint text options, let me know what you think. Thanks.
!enumeration2.png|thumbnail!
> Data type constraints: Day/Time Duration
> ----------------------------------------
>
> Key: DROOLS-3454
> URL: https://issues.jboss.org/browse/DROOLS-3454
> Project: Drools
> Issue Type: Story
> Components: DMN Editor
> Reporter: Liz Clayton
> Assignee: Liz Clayton
> Priority: Major
> Labels: UX, UXTeam, drools-tools
> Attachments: enumeration2.png, range2.png
>
>
> Background
> Persona: Business analyst or Rules practitioner
> Use Cases:
> * From the DMN canvas view - as a user I want to define data type restrictions (one-off instances) from a decision table .
> * From the Data Types tab - as a user I want the ability to define constraints for the following types: Day/Time Duration (Expression, Enumeration, and Range.)
> Functional considerations/ pre conditions:
> * Consider interaction in light of Property panel and consistency.
> * Underscore the notion of one-off constraints.
> Verification conditions:
> * Scrum team and PO review.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months