You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kshitiz <k....@gmail.com> on 2012/08/02 15:25:58 UTC

Need suggestion on minimizing session usage in wicket web application

Hi,

I need some suggestions. In my wicket application (in development phase), I
have used normal forms and links. While going through the concept of
stateless pages and forms, I am confused about converting the forms and
components to stateless. Will it really minimize session usage in the
system. I need to minimize it as i wont be having much server space
initially. 



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956.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: Need suggestion on minimizing session usage in wicket web application

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
Do you use Wicket 6? If so, the latest snapshot includes an "enhanced" 
page view in the page inspector of the Wicket debug bar. This page view 
can be filtered to show only stateful components and behaviors.

If you're on Wicket 1.5, check out 
https://issues.apache.org/jira/browse/WICKET-4244. 
"stateful_page_inspector.patch" has the version I submitted for 1.5 in 
November. You can have a look at the screenshots in the issue to see 
what it does.


On 03/08/2012 10:44 AM, kshitiz wrote:
> Ya..that worked...and for each component...I think statelessChecker is there.
> But I am not able to figure out how to use it for a component? I read you
> post
> http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
> http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
> But not able to get...
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650987.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
>


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


Re: Need suggestion on minimizing session usage in wicket web application

Posted by kshitiz <k....@gmail.com>.
Ya..that worked...and for each component...I think statelessChecker is there.
But I am not able to figure out how to use it for a component? I read you
post 
http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html 
But not able to get...



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650987.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: Need suggestion on minimizing session usage in wicket web application

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Aug 3, 2012 at 5:11 PM, kshitiz <k....@gmail.com> wrote:
> Actually I am planning to host the app in Google application engine. One
> thing I am not able to understand, getStatelessHint() if applied in the
> constructor of a page should return whether that page is stateless or not.
> So, in my page which is full of ajax and statefull components, why it is
> printing true? I am simply printing...
>
>         public Page(PageParameters pageParameters)(
>                         final PageParameters pageParameters, UserDomain userDomain,
>                         UserDomain loggedInUserDomain) {
>
> // many statefull components added
> *System.out.println(this.getStatelessHint());*  returning true..!!!!

use #isPageStateless() instead.

> }
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650982.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: Need suggestion on minimizing session usage in wicket web application

Posted by kshitiz <k....@gmail.com>.
Actually I am planning to host the app in Google application engine. One
thing I am not able to understand, getStatelessHint() if applied in the
constructor of a page should return whether that page is stateless or not.
So, in my page which is full of ajax and statefull components, why it is
printing true? I am simply printing...

	public Page(PageParameters pageParameters)(
			final PageParameters pageParameters, UserDomain userDomain,
			UserDomain loggedInUserDomain) {

// many statefull components added
*System.out.println(this.getStatelessHint());*  returning true..!!!!
}



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650982.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: Need suggestion on minimizing session usage in wicket web application

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
I have not used stateless ajax myself so I can't help you much there. 
Have a look here for stateless ajax:
https://github.com/jolira/wicket-stateless

Also, before you make such big modifications, I suggest you take the 
time to profile the memory usage of your pages. There could be a 1-hour 
fix available to your problem depending on its source.

On 03/08/2012 2:48 AM, kshitiz wrote:
> Okk....I think for large user base, I should go for stateless pages. But the
> problem is that my app is entirely ajax based. So, how would I use ajax
> behavior for stateless components. As far as I have read, ajax requires
> components to be stateful
> (/http://apache-wicket.1842946.n4.nabble.com/stateless-ajax-behavior-td1933611.html/).
> Will it be possible for me to use same ajax behavior like updating panel,
> etc on stateless pages?
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650976.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
>


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


Re: Need suggestion on minimizing session usage in wicket web application

Posted by kshitiz <k....@gmail.com>.
Okk....I think for large user base, I should go for stateless pages. But the
problem is that my app is entirely ajax based. So, how would I use ajax
behavior for stateless components. As far as I have read, ajax requires
components to be stateful
(/http://apache-wicket.1842946.n4.nabble.com/stateless-ajax-behavior-td1933611.html/).
Will it be possible for me to use same ajax behavior like updating panel,
etc on stateless pages?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650976.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: Need suggestion on minimizing session usage in wicket web application

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
I would say it depends. Generally, it should help to use detachable 
models, but for very small objects (like static strings), it's won't 
give a big gain. Besides memory gains, detachable models also reload 
their data each request which ensures non-stale objects.


On 02/08/2012 11:28 AM, kshitiz wrote:
> Thanks for the links. One thing that I want to ask that do yo think we should
> use LoadableDetachable models to minimize session usage? Like for every
> thing examples labels, links, dropdowns, etc.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650963.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
>


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


Re: Need suggestion on minimizing session usage in wicket web application

Posted by kshitiz <k....@gmail.com>.
Thanks for the links. One thing that I want to ask that do yo think we should
use LoadableDetachable models to minimize session usage? Like for every
thing examples labels, links, dropdowns, etc.  



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650963.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: Need suggestion on minimizing session usage in wicket web application

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
Hi,

You can read the following email thread for insight:
http://wicket-users.markmail.org/thread/6qqc4pxt77mulpmt

Also have a look at this:
http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

These links talk about session size in general, not only about stateless 
components.

On 02/08/2012 9:25 AM, kshitiz wrote:
> Hi,
>
> I need some suggestions. In my wicket application (in development phase), I
> have used normal forms and links. While going through the concept of
> stateless pages and forms, I am confused about converting the forms and
> components to stateless. Will it really minimize session usage in the
> system. I need to minimize it as i wont be having much server space
> initially.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956.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
>


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


Re: Need suggestion on minimizing session usage in wicket web application

Posted by Andrea Del Bene <an...@gmail.com>.
yes, using stateless pages when it's possible will definitely reduce 
your session size. Wicket offers a stateless version for those 
components which by default  have a stateful nature, like forms and 
links. As general rule you can implement a stateless page when the page 
doesn't need to keep its internal state between two consecutive 
requests. For more information on stateless pages see live examples at 
http://www.wicket-library.com/wicket-examples/stateless/
> Hi,
>
> I need some suggestions. In my wicket application (in development phase), I
> have used normal forms and links. While going through the concept of
> stateless pages and forms, I am confused about converting the forms and
> components to stateless. Will it really minimize session usage in the
> system. I need to minimize it as i wont be having much server space
> initially.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956.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
>


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


Re: Need suggestion on minimizing session usage in wicket web application

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Aug 2, 2012 at 11:37 PM, robmcguinness
<ro...@gmail.com> wrote:
>
> food for though in 6.0 branch
>
>
>
> getFrameworkSettings().setSerializer(new
> DeflatedJavaSerializer(getApplicationKey()));

This wont help for the session size. The http session keeps only the
last used page instance. The serialized page (the bytes) are stored in
disk store unless you use HttpSessionDataStore (for Google AppEngine
for example).
Read https://cwiki.apache.org/confluence/display/WICKET/Page+Storage

>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650973.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: Need suggestion on minimizing session usage in wicket web application

Posted by robmcguinness <ro...@gmail.com>.
food for though in 6.0 branch



getFrameworkSettings().setSerializer(new
DeflatedJavaSerializer(getApplicationKey()));




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650973.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