You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by heikki <tr...@gmail.com> on 2011/08/07 00:10:56 UTC

URLs without counter parameter

Hello,

I'm using Wicket 1.5M3 and I'm trying to have nice-looking URLs in my web
app.

The URLs produced by the code as below are almost perfect, except for one
detail: always, there is a counter appended, reflecting the number of
requests made in this session.


For example I get http://localhost:8080/myapp/contact?3, when I would prefer
to have just http://localhost:8080/myapp/contact.


All my pages are stateless -- at least that is what I think they are, many
do not even have any code in their corresponding Java class. I also tried
using setStatelessHint(true); but the results are the same.

The code I use is:

in MyApplication.java's init() method

        mountPage("/contact", ContactPage.class);

etc., for all pages; and when creating links to the pages in the site's
menu, I do

       add(new BookmarkablePageLink("contact-link", ContactPage.class));

with
        # contact 

in the HTML.


Is it possible to get rid of those ?x that are appended to the URLs ?


thank you in advance for your answers
kind regards
Heikki Doeleman




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/URLs-without-counter-parameter-tp3724144p3724144.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: URLs without counter parameter

Posted by Martin Grigorov <mg...@apache.org>.
Welcome ;-)

Another hint: there is 1.5-RC5.1. No need to use older version like 1.5-M3.

On Sun, Aug 7, 2011 at 4:03 PM, heikki <tr...@gmail.com> wrote:
> OK,
>
> it turned out that a form in my base page with links to change the language
> was the stateful component. I've now changed things so it is a stateless
> form and it works like a charm.
>
>
> Thanks for hinting at StatelessChecker !
>
> Kind regards
> Heikki Doeleman
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/URLs-without-counter-parameter-tp3724144p3724820.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: URLs without counter parameter

Posted by heikki <tr...@gmail.com>.
OK,

it turned out that a form in my base page with links to change the language
was the stateful component. I've now changed things so it is a stateless
form and it works like a charm.


Thanks for hinting at StatelessChecker !

Kind regards
Heikki Doeleman

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/URLs-without-counter-parameter-tp3724144p3724820.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: URLs without counter parameter

Posted by Martin Grigorov <mg...@apache.org>.
The counter is there only for stateful pages.
setStatelessHint(true) is just a hint. The statelessness is calculated
at render time - if all components in the page are stateless then the
page is stateless too.
To find which component makes it stateful use wicket-devutils's
StatelessChecker + @StatelessComponent

On Sun, Aug 7, 2011 at 1:14 AM, heikki <tr...@gmail.com> wrote:
> sorry, did not escape html in my post. That should be:
>
> with
>
> # contact
>
>
> in the HTML.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/URLs-without-counter-parameter-tp3724144p3724147.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: URLs without counter parameter

Posted by heikki <tr...@gmail.com>.
sorry, did not escape html in my post. That should be:

with
       
# contact 


in the HTML.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/URLs-without-counter-parameter-tp3724144p3724147.html
Sent from the Users forum mailing list archive at Nabble.com.

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