Where are you going to remove an "if check" ? Because I think that might be a problem if you remove the complete

public final void mount(String path, IRequestTargetUrlCodingStrategy encoder) {
        ...
        if (path.equals("/"))
        {
            throw new IllegalArgumentException(
                    "The mount path '/' is reserved for the application home page");
        }
        ...
}

from the WebRequestCodingStrategy.

the patch is to check if the relying IRequestTargetUrlCodingStrategy encoder is of type PackageRequestTargetUrlCodingStrategy. If so, leave it do the mount.


On 5/8/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
ok, just wanted to make sure the functionality for routing packages mounted on / was still working. i think jonathan added that if check because he was unaware of this usecase. i will clean it up.


-Igor


On 5/8/06, Bruno Borges <[EMAIL PROTECTED] > wrote:
Movin to the correct list...

I did a change in the line
wicket.protocol.http.request.WebRequestCodingStrategy:258

if (path.equals("/") && encoder instanceof PackageRequestTargetUrlCodingStrategy == false)

Looks like everything went fine.

But this was a first shot on how to fix the problem. Maybe theres a better solution.


On 5/8/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
can you remove that if statement and see if it works?


-Igor


On 5/8/06, Bruno Borges <[EMAIL PROTECTED] > wrote:
And is exactly that. it throws an exception saying that the path can't be "/". I saw the source and there's an If statement checking for this.

:)



On 5/8/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
if you are talking about mounting a package on / then you should be able to do that with something like mount("/", PackageName.for(Index.class));

then if you have an Index.class page in that package it should be accessible from /site/Index

at least i remember i wrote this functionality in because it was requested before. maybe it got lost with some of the refactorings we did. if so, then we should fix it.


-Igor


On 5/8/06, Bruno Borges <[EMAIL PROTECTED]> wrote:
Yeah, it's /site/*, I just cutted off the unnecessary info. Sorry... :D
So, how about something like:

mountByClassName(String underPath, PackageName pkg);

this would be the same as loop through all classes located under the pkg and create a mounted path with the same name as the class.

I know this can be done outside Wicket's core API. Just calling some of the already built-in methods. But it would be nice to have a shortcut.

Regards,


On 5/8/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
you cannot mount onto / because that is reserved for the homepage, so in a way homepage is always mounted on /

if you want to mount something onto /site/index then you need to mount on /index not /
mount("/index", Index.class);

btw, your url mapping should be /site/* not just /site

-Igor



On 5/8/06, Bruno Borges < [EMAIL PROTECTED]> wrote:
Why can't I mount my pages so they all can be bookmarkable from "/" ?

Just a note: the WicketServlet is under url-pattern = /site, so my pages would be bookmarkable like "/site/Index".

Regards,

--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4




--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4




--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4




--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4




--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4

Reply via email to