Stripes

Some ActionBeans are not correctly mapped using clean URLs

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.5
  • Component/s: ActionBean Dispatching
  • Labels:
    None

Description

In the case of @UrlBinding("/search/{p}.action") the following URIs should be able to map to SearchActionBean:

/search
/search.action
/search/1
/search/1.action

To support exact matches without relying on prefixes or suffixes in the URI, UrlBindingFactory maps paths to ActionBeans in a map called pathCache so ActionBeans can quickly be matched to a URI. If no match is found then it iterates over the keys in prefixCache, checking if any of the known valid prefixes match the beginning of the URI. In the case of the example binding above, it caches /search as a valid path, but it does not cache the equally valid /search.action. The path lookup fails to find a match in this case, and so does the prefix scan because the only valid prefix is /search/.

This is an easy fix. There are two possible paths that need to be cached for a UrlBinding: the prefix alone (/search) and if the suffix (.action) is not null then prefix + suffix (/search.action).

Activity

Hide
Ben Gunter added a comment - 07/May/08 9:40 AM

Fixed as described

Show
Ben Gunter added a comment - 07/May/08 9:40 AM Fixed as described

People

Vote (0)
Watch (0)

Dates

  • Created:
    07/May/08 9:28 AM
    Updated:
    04/Jan/11 1:10 PM
    Resolved:
    07/May/08 9:40 AM