RE: Homepage runs 2 times if I mount it as /

2012-03-26 Thread Wilhelmsen Tor Iver
 /;jsessionid=6730E8A6F6FED95C9AC24E7A37F3A35A?0

This is added by the web container in case the browser does not support 
cookies. It is added on the first response regardless, and also on subsequent 
ones if the browser does not accept cookies, or you turn it off (e.g. using 
cookies=false in the context.xml for Tomcat)

- Tor Iver

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



Re: Homepage runs 2 times if I mount it as /

2012-03-25 Thread Paolo
Alle venerdì 23 marzo 2012, Jeff Schneller ha scritto:
 I may be wrong but you don't need to mount the homepage which is why it is 
 being executed twice. 

Yes, ok, you are right.
But the problem was start because I use the NoVersionMount to mount homepage 
because I don't like that the url of page have this add:

/;jsessionid=6730E8A6F6FED95C9AC24E7A37F3A35A?0

So, can you suggest a good solution?

--
@Override
protected void init()
{
super.init();
// mountPage(/, HomePage.class);
mount(new NoVersionMount(/, HomePage.class));
mount(new NoVersionMount(watch, V.class))  
}
}

/**
 * Provides a mount strategy that drops the version number from
 * stateful page urls.
 */
class NoVersionMount extends MountedMapper {
public NoVersionMount(String path, Class? extends IRequestablePage 
pageClass) {
super(path, pageClass, new PageParametersEncoder());
}

@Override protected void encodePageComponentInfo(Url url, PageComponentInfo 
info)
{
// do nothing so that component info does not get
// rendered in url
}

@Override public Url mapHandler(IRequestHandler
requestHandler)
{
if (requestHandler instanceof ListenerInterfaceRequestHandler) {
return null;
} else {
return super.mapHandler(requestHandler);
}
}
}

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



Re: Homepage runs 2 times if I mount it as /

2012-03-23 Thread Jeff Schneller
I may be wrong but you don't need to mount the homepage which is why it is 
being executed twice. 

On Mar 23, 2012, at 1:36 PM, Paolo irresistible...@gmail.com wrote:

 I made bookmarkable the HomePage:
 
 But it is executed two times!!!
 Infact it make me crazy!
 I put an System.out.printf to check it in the console log.
 Because the page in the browser look like to load only one time,
 but in the console I can read 2 times printf line!
 
 If I mount it as something different by / homepage runs only one time.
 
 This is the main of my app called watch:
 ---
 public class MainApplication extends WebApplication
 {
@Override
public Class getHomePage()
{
return HomePage.class;
}
 
@Override
protected void init()
{
super.init();
mountPage(/, HomePage.class);
mountPage(print.html, Print.class);
mount(new NoVersionMount(watch, V.class));
}
 }
 -
 If I replace it with mountPage(home, HomePage.class); it works normally.
 
 Url string after first start:
 
 http://localhost:8080/watch/?0
 
 Url string after reload page:
 
 http://localhost:8080/watch/?2
 
 --
 
 If I mount page as
 
 mountPage(, HomePage.class);
 
 I got this error:
 java.lang.IllegalArgumentException: Argument 'mountPath' may not be null or 
 empty.
 
 -
 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