[ 
https://issues.apache.org/jira/browse/TAP5-879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922991#action_12922991
 ] 

Josh Canfield commented on TAP5-879:
------------------------------------

Instead of using a request filter, couldn't we just add a 
DefaultOnActivateWorker that comes in after OnEventWorker and checks for these 
conditions? (maybe it goes in OnEventWorker but that seems like a separate 
concern)

I'd propose that an onActivate(EventContext) gets added if one of the "all 
parameter" forms doesn't exist, if it exists then we don't add. The method will 
get built with the knowledge of the other activate handlers and use that to 
decide what to do.

What the right logic to put here is a little debatable. I don't know if we 
should test that the incoming parameters match exactly. I have an image 
component that accepts 1 parameter but is always passed 2 since I append a 
friendly file name for SEO. I don't implement an onActivate handler that 
accepts that second parameter, but maybe I should?

Returning 404 for type mismatch is also an interesting idea that could be put 
into the injected default activate method.

> 404 is never raised automatically if the application has an index page.
> -----------------------------------------------------------------------
>
>                 Key: TAP5-879
>                 URL: https://issues.apache.org/jira/browse/TAP5-879
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Christophe Cordenier
>         Attachments: TAP5-879.txt, TAP5-986.txt
>
>
> The default behavior of PageRenderDispatcher when a user access to a URL like 
> 'http://localhost/demo/blah' (where 'demo' is the application context and 
> 'blah' is a page that does not exist) is to translate to 
> 'http://localhost/demo/index/blah' if an index page exists even if it has no 
> activation method.
> It could be a better solution to check if a the index page has an activation 
> method with the corresponding parameter number and type, and automatically 
> raise a http 404 if not.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to