> Yeah, you can give provide a HINT that they shouldn't be stored (that
> they are stateless) by overriding getStatelessHint on the components
> you put on the page. Note that if there is just one stateful component
> on the page, that'll trigger the page to be marked as stateful UNLESS
> you explicitly mark the page itself stateless (which is a bit cheaper
> by the way, as it won't iterate over it's children to find out whether
> it is stateless).
>
i thought even if you explicitly mark a page as stateless that has stateful
components ( link, form, etc ), it
would still render as stateful ( creating session ) ????????????? isn't that
the behaviour?
Eelco Hillenius wrote:
>
>> Thanks to everyone for their help - I'm starting right away to convert
>> everything to detachable models for all domain objects that are loaded
>> into
>> components...
>
> If you're only working with stateless pages, you don't detachable
> models as those pages won't be stored to start with. But if you want
> to reuse the models and components in stateful pages, it is better to
> have that.
>
>> Eelco, I am curious about your statement "when you have no callbacks,
>> you're
>> page will be stateless and not kept in memory"... Most of my pages have
>> no
>> callbacks (by callback, I'm assuming that you mean a link that would have
>> reference to wicket components in the URL, meaning that it is storing the
>> state of that component so that it can further interact with it).
>
> Yep. Normal Links, Forms, ajax requests etc.
>
>> I have
>> taken great care to control the URLs of the application, so almost every
>> page has only components that have standard URLs, with no references to
>> any
>> components, etc. The forms will obviously have a call back, and certain
>> links (particularly if you are signed in as an administrator - a lot of
>> links appear to edit and delete content that are all direct callbacks
>> with
>> obviously no direct URL encoding / decoding so that you can not use them
>> outside of your session).
>
> Not sure what you're getting at...
>
>> So, how do I know if it's storing the pages in memory? Is there
>> something I
>> can do to tell it not to?
>
> Yeah, you can give provide a HINT that they shouldn't be stored (that
> they are stateless) by overriding getStatelessHint on the components
> you put on the page. Note that if there is just one stateful component
> on the page, that'll trigger the page to be marked as stateful UNLESS
> you explicitly mark the page itself stateless (which is a bit cheaper
> by the way, as it won't iterate over it's children to find out whether
> it is stateless).
>
> The method where this all happens is Page#isPageStateless.
>
> Also, if you want to keep track of when user sessions are created,
> create a custom session store by overriding newSessionStore on
> Application and let your custom store extend HttpSessionStore or
> SecondLevelCacheSessionStore and then override onBind which will be
> called when (new) sessions are bound to the HttpSession.
>
> Eelco
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
--
View this message in context:
http://www.nabble.com/Sessionless-Wicket--tf3684664.html#a11738136
Sent from the Wicket - User mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user