Stripes

support default handler name to be omitted for link and url tags

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.5.1
  • Component/s: Tag Library
  • Labels:
    None

Description

URLs that are created with stripes:link or stripes:url always contain the event name, even when none is given, so that the default handler will be used. I'd like to have a way to omit the default handler name, since most of the time, it doesn't have an @HandlesEvent annotation and the handler method name will be used.

UrlBuilder supports leaving off the event nameby accepting null as the event name. This is not possible with the link and url tags, since the event name is only set by LinkTagSupport when it's not-null.

I see two possible fixes (but maybe there are more elegant ones):

  • allow null values for the event tag attribute (this requires checking whether event is null because it was never set or that it was explicitly set as null in buildUrl);
  • treat an empty string as null for the event name.

Activity

Hide
Levi Hoogenberg added a comment - 08/Aug/08 1:40 PM

Patch for the first alternative.

Show
Levi Hoogenberg added a comment - 08/Aug/08 1:40 PM Patch for the first alternative.
Hide
Levi Hoogenberg added a comment - 09/Aug/08 10:24 AM

I added a patch for OnwardResolution, that has the same behaviour.

Show
Levi Hoogenberg added a comment - 09/Aug/08 10:24 AM I added a patch for OnwardResolution, that has the same behaviour.
Hide
Ben Gunter added a comment - 11/Aug/08 6:51 AM

This is a reasonable request, but we've frozen 1.5 so it will have to wait until 1.5.1. For the tags, I think allowing event="" to explicitly exclude the event parameter is a good idea.

It's not clear from the description that you are talking specifically about cases where the event name is embedded in the URL, such as @UrlBinding("/foo/{$event}"). I thought I'd spell that out in my comment for documentation purposes. I tested cases where {$event} is not specified, and this does not apply there.

Show
Ben Gunter added a comment - 11/Aug/08 6:51 AM This is a reasonable request, but we've frozen 1.5 so it will have to wait until 1.5.1. For the tags, I think allowing event="" to explicitly exclude the event parameter is a good idea. It's not clear from the description that you are talking specifically about cases where the event name is embedded in the URL, such as @UrlBinding("/foo/{$event}"). I thought I'd spell that out in my comment for documentation purposes. I tested cases where {$event} is not specified, and this does not apply there.
Hide
Ben Gunter added a comment - 23/Dec/08 9:54 AM

Fixed for 1.5.1.

Show
Ben Gunter added a comment - 23/Dec/08 9:54 AM Fixed for 1.5.1.
Hide
Levi Hoogenberg added a comment - 23/Dec/08 10:25 AM

Thanks [though I have a couple of events named VALUE_NOT_SET ;)].

Is there a reason that OnwardResolution didn't get the same treatment? It'd be nice to be able to explicitly suppress the default event name when constructing a Forward/RedirectResolution as well.

Show
Levi Hoogenberg added a comment - 23/Dec/08 10:25 AM Thanks [though I have a couple of events named VALUE_NOT_SET ;)]. Is there a reason that OnwardResolution didn't get the same treatment? It'd be nice to be able to explicitly suppress the default event name when constructing a Forward/RedirectResolution as well.
Hide
Ben Gunter added a comment - 23/Dec/08 1:13 PM

No reason other than I overlooked that part. It's fixed now.

Show
Ben Gunter added a comment - 23/Dec/08 1:13 PM No reason other than I overlooked that part. It's fixed now.

People

Vote (0)
Watch (0)

Dates

  • Created:
    08/Aug/08 1:15 PM
    Updated:
    04/Jan/11 2:50 PM
    Resolved:
    23/Dec/08 9:54 AM