[ 
https://issues.apache.org/jira/browse/WICKET-2881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889641#action_12889641
 ] 

Juergen Donnerstag commented on WICKET-2881:
--------------------------------------------

I'll try it again.If you want to change the behavior which eventually gets 
attached to the component and which modifies the path, than
1) you need to copy RelativePathPrefixHandler (yes, sorry. That's how it 
currently works). 
2) remove "implements IComponentResolver" and the resolve() method. You will 
not need it.
3) modify the behavior within MyRelativePathPrefixHandler as you like
4) Define a class MyMarkupParserFactory which extends MarkupParserFactory
5) subclass MarkupParserFactory.newMarkupParser() to add your own 
implementation of RelativePathPrefixHandler  (see MarkupParserFactory javadoc). 
Your own MyRelativePathPrefixHandler  will be added before the original 
RelativePathPrefixHandler and thus "replace it".
6) register your MyMarkupParserFactory with IMarkupSettings via 
setMarkupParserFactory(IMarkupParserFactory()

Juergen

> Cannot substitute RelativePathPrefixHandler
> -------------------------------------------
>
>                 Key: WICKET-2881
>                 URL: https://issues.apache.org/jira/browse/WICKET-2881
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.8
>         Environment: All
>            Reporter: bernard
>         Attachments: DirectoryStructure.gif, HomePage.html
>
>
> In IPageSettings
> Get the (modifiable) list of IComponentResolvers.
> List<IComponentResolver> getComponentResolvers();
> This looks very useful and easy indeed, and in Application.init() one can 
> find and remove
> RelativePathPrefixHandler and replace it with a different 
> AbstractMarkupFilter implementation e.g. XRelativePathPrefixHandler.
> But even while the List.remove(Object o) returns true, and the handler 
> appears to be removed, it is still active.
> I don't know why and what holds on to it or what creates a new 
> RelativePathPrefixHandler.
> If I add my XRelativePathPrefixHandler, it is not used.
> Consider
> public class MarkupParser
> public final void appendMarkupFilter(final IMarkupFilter filter)
> {
>     appendMarkupFilter(filter, RelativePathPrefixHandler.class);
> }
> So RelativePathPrefixHandler seems to be something special and I am afraid of 
> other potential complications in case replacement would work.
> Can Wicket be fixed to make a replacement as easy as it appears to be?

-- 
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