History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: STS-596
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Ben Gunter
Reporter: Levi Hoogenberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Stripes

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

Created: 08/Aug/08 01:15 PM   Updated: 23/Dec/08 01:13 PM
Component/s: Tag Library
Affects Version/s: Release 1.5
Fix Version/s: Release 1.5.1

File Attachments: 1. Text File allow_null.patch (1 kb)
2. Text File allow_null_onward_resolution.patch (1 kb)



 Description  « Hide
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.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Levi Hoogenberg - 08/Aug/08 01:40 PM
Patch for the first alternative.

Levi Hoogenberg - 09/Aug/08 10:24 AM
I added a patch for OnwardResolution, that has the same behaviour.

Ben Gunter - 11/Aug/08 06: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.

Ben Gunter - 23/Dec/08 09:54 AM
Fixed for 1.5.1.

Levi Hoogenberg - 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.

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