Re: Mounting a parameter on the root url crashes resource location wicket

2015-04-08 Thread Martin Grigorov
Hi,

/wicket is nothing special. Every application can use it for its own needs.
The problem is that your mount path would match anything. Even
'/something/that/do/not/exist'.

There are several solutions. Here is one of them:

Override MountedMapper#urlStartsWithMountedSegments(Url url) to return
'true' only if the url has a single segment (the username)
MyApp.mount(new MountedMapper(/${username}, ProfilePage.class) {
  @Override protected boolean urlStartsWithMountedSegments(Url url) {return
url.getSegments().size() == 1;}
})

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Apr 7, 2015 at 10:33 PM, wiseguy2 folarinomotorio...@gmail.com
wrote:

 In a social network, that seems redundant especially when users will be
 sharing the links on other platforms. Is it not possible for wicket to
 treat
 the /wicket/* urls differently with a separate filter so that mounting a
 parameter in root doesnt collapse resource resoclution? This is where the
 problem lies.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Mounting-a-parameter-on-the-root-url-crashes-resource-location-wicket-tp4670175p4670217.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Mounting a parameter on the root url crashes resource location wicket

2015-04-08 Thread wiseguy2
This is what I was looking for. A way to tell the url segments apart. Thank
you. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mounting-a-parameter-on-the-root-url-crashes-resource-location-wicket-tp4670175p4670220.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Mounting a parameter on the root url crashes resource location wicket

2015-04-07 Thread wiseguy2
I have that in the actual code. 

I have two pages mounted. 

1. Home page at / pointing to Index.class 
2. Person profile page /${username}

Each time wicket tries to load a resource e.g
./wicket/resources/package/jquery.css

it calls the person profile page.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mounting-a-parameter-on-the-root-url-crashes-resource-location-wicket-tp4670175p4670202.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Mounting a parameter on the root url crashes resource location wicket

2015-04-07 Thread Martin Grigorov
Well, Wicket matches the request at /wicket.
resources/package/jquery.css are then treated as path parameters:
parameters.get(0) == resources
parameters.get(1) == package
parameters.get(2) == jquery.css

As I suggested at StackOverflow: use Index.java as a dispatcher. If there
is parameters.get(0) then show profile data, otherwise the home page.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Apr 7, 2015 at 1:43 PM, wiseguy2 folarinomotorio...@gmail.com
wrote:

 I have that in the actual code.

 I have two pages mounted.

 1. Home page at / pointing to Index.class
 2. Person profile page /${username}

 Each time wicket tries to load a resource e.g
 ./wicket/resources/package/jquery.css

 it calls the person profile page.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Mounting-a-parameter-on-the-root-url-crashes-resource-location-wicket-tp4670175p4670202.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Mounting a parameter on the root url crashes resource location wicket

2015-04-07 Thread Christoph Läubrich


Why not simply use /profile/${username} or something like 
/user-${username}?



Am 07.04.2015 12:43, schrieb wiseguy2:

I have that in the actual code.

I have two pages mounted.

1. Home page at / pointing to Index.class
2. Person profile page /${username}

Each time wicket tries to load a resource e.g
./wicket/resources/package/jquery.css

it calls the person profile page.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mounting-a-parameter-on-the-root-url-crashes-resource-location-wicket-tp4670175p4670202.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

   



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Mounting a parameter on the root url crashes resource location wicket

2015-04-05 Thread Martin Grigorov
Hi,

On Mon, Apr 6, 2015 at 2:34 AM, wiseguy2 folarinomotorio...@gmail.com
wrote:

 in my wicket application settings I wish to mount a parameter on the root
 /
 like

 mountPage (Profile.class, /{username}) similar to how twitter and
 facebook


The mount path should be: ${username}. I.e. with a leading '$'.


 maps the usernames to its accounts. In wicket 7, this seems to crash the
 resource location algorithm. In the sense that all css, js files now load
 with 404.


Crashes how exactly? We need more details to be able to help you.



 Is there a work around this?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Mounting-a-parameter-on-the-root-url-crashes-resource-location-wicket-tp4670175.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org