You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sudeivas <su...@gmail.com> on 2012/04/01 04:54:18 UTC

Re: Version Pages by default

Most often we don't want users to see the parameters in the URL. But when I
tried using 
setResponsePage(PageA.class, pageParameters) and after mounting the page in
my application I see the parameters in the URL. 

So I was referring to 

http://stackoverflow.com/questions/6390953/how-can-i-create-a-wicket-url-that-hides-its-parameters

and found that we can mount pages without showing the parameters in the URL. 

My question is what will happen when session expires. After setting
setRecreateMountedPagesAfterExpiry(true), will it be able to recreate the
page from mountedPages because the URL will not be having the parameters. 

Basically I want to achieve setRecreateMountedPagesAfterExpiry(true) and
also want to hide parameters from the user. 

Please advise. 

Thanks,
Suresh

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4522696.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: Version Pages by default

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Apr 2, 2012 at 6:28 PM, sudeivas <su...@gmail.com> wrote:
> Now I am using
>
> IRequestMapper cryptoMapper = new CryptoMapper(getRootRequestMapper(),
> this);
> setRootRequestMapper(cryptoMapper);
>
> By this way the page parameters are encrypted. I hope it will not affect
> recreating the page from page mount when the page expiration happens.
>
> Also can you please answer my above question regarding StalePageException or
> any links to regarding this will also help.

See the javadoc of Page#renderCount field.

>
> Thanks,
> Suresh
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4526510.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: Version Pages by default

Posted by sudeivas <su...@gmail.com>.
Now I am using 

IRequestMapper cryptoMapper = new CryptoMapper(getRootRequestMapper(),
this);
setRootRequestMapper(cryptoMapper);

By this way the page parameters are encrypted. I hope it will not affect
recreating the page from page mount when the page expiration happens. 

Also can you please answer my above question regarding StalePageException or
any links to regarding this will also help.

Thanks,
Suresh

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4526510.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: Version Pages by default

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Apr 2, 2012 at 6:37 AM, sudeivas <su...@gmail.com> wrote:
> I have made changes in the code to set all the parameters in the Session. Now
> the URL looks clean.
>
> http://xxxx/pageB?5
>
> But in pageB's constructor after reading values from session I am not
> clearing it as we need those values in the session. When the page expiration
> happens, when wicket tries to reload the page from mounted pages, then the
> values stored in the session will be helpful. Please correct me if I am
> wrong.

Wrong.
Most of the times PageExpirationException is caused due to expired
session. I.e. there wont be any values in the session when the page is
recreated.

>
> Another question related to these page expirations. I am also seeing lot of
> org.apache.wicket.request.mapper.StalePageException in
> production(distributed environment). What is the real cause of this? I am
> not seeing much of information from stack trace. Is this happening because
> we use lot of stateless pages? or Is this happening because we didn't
> version pages (prior to the start of this thread)? Please note I haven't
> moved the changes in this thread to production.
>
>
> Exception Stack Trace : org.apache.wicket.request.mapper.StalePageException
>        at
> org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:302)
>        at
> org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:257)
>        at
> org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
>        at
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getPage(ListenerInterfaceRequestHandler.java:100)
>        at
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:165)
>        at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
>        at
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>        at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
>        at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
>        at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>        at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>        at
> de.javakaffee.web.msm.SessionTrackerValve.invoke(SessionTrackerValve.java:147)
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>        at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
>        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>        at java.lang.Thread.run(Thread.java:662)
>
>
> Thanks,
> Suresh
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4525167.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: Version Pages by default

Posted by sudeivas <su...@gmail.com>.
I have made changes in the code to set all the parameters in the Session. Now
the URL looks clean.

http://xxxx/pageB?5

But in pageB's constructor after reading values from session I am not
clearing it as we need those values in the session. When the page expiration
happens, when wicket tries to reload the page from mounted pages, then the
values stored in the session will be helpful. Please correct me if I am
wrong.

Another question related to these page expirations. I am also seeing lot of
org.apache.wicket.request.mapper.StalePageException in
production(distributed environment). What is the real cause of this? I am
not seeing much of information from stack trace. Is this happening because
we use lot of stateless pages? or Is this happening because we didn't
version pages (prior to the start of this thread)? Please note I haven't
moved the changes in this thread to production.


Exception Stack Trace : org.apache.wicket.request.mapper.StalePageException
	at
org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:302)
	at
org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:257)
	at
org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
	at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getPage(ListenerInterfaceRequestHandler.java:100)
	at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:165)
	at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
	at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
	at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
de.javakaffee.web.msm.SessionTrackerValve.invoke(SessionTrackerValve.java:147)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)


Thanks,
Suresh

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4525167.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: Version Pages by default

Posted by Martin Grigorov <mg...@apache.org>.
Using setResponsePage(Page) wont work. This will create url like:
.../wicket/page?6 and there is no way to find what is the type of the
page behind this url. Using setResponsePage(Class) the url will be
.../pageB and this is what is needed to find out which Page
implementation to use after session expiration.

You can put the parameters in the Session instead of in
PageParameters. This way the url will be ../pageB without parameters.
And in PageB's constructor you will read the saved params and clear
them. Just an idea.

On Sun, Apr 1, 2012 at 4:54 AM, sudeivas <su...@gmail.com> wrote:
> Most often we don't want users to see the parameters in the URL. But when I
> tried using
> setResponsePage(PageA.class, pageParameters) and after mounting the page in
> my application I see the parameters in the URL.
>
> So I was referring to
>
> http://stackoverflow.com/questions/6390953/how-can-i-create-a-wicket-url-that-hides-its-parameters
>
> and found that we can mount pages without showing the parameters in the URL.
>
> My question is what will happen when session expires. After setting
> setRecreateMountedPagesAfterExpiry(true), will it be able to recreate the
> page from mountedPages because the URL will not be having the parameters.
>
> Basically I want to achieve setRecreateMountedPagesAfterExpiry(true) and
> also want to hide parameters from the user.
>
> Please advise.
>
> Thanks,
> Suresh
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4522696.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