You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marcel Barbosa Pinto <ma...@gmail.com> on 2015/10/15 16:45:36 UTC

Wicket.Ajax on static pages loading stateful components.

Hi guys,

I am developing a heavy traffic web site entirely in Wicket 7 and I have
some questions about page caching.

The approach I took was to generate the product page HTML from Wicket
statically saving these files to be served direct to the user as a Wicket
Resource.

These pages has a Wicket contact form panel witch are dynamically loaded
using my own ajax that calls the mounted form panel from and manually
updates the HTML the the form panel generated markup.

//pseudo code ^^

//normal wicket form panel
mount("ad/contact")

//static page page
mount("/ad/page{#id}", Resource("/static/produtc-details-{#id}.html"))

This is working, but is not a good solution as I could only manage to get
the entire form html.
Inside the contact form I have a captcha that has an ajax link to refresh
its image.

I would like to have a #formContainer at the static page then using the
Wicket.Ajax be able to refresh the container HTML (ad/contact) and when the
captcha needs the refresh, only the captcha has to be updated, so the user
doesn't loose the form text he could have inserted.

It is possible to load the contact form from the static generated HTML
using the Wicket.Ajax and have the ajax component update working?

If you guys have a better approach to this problem, please let me know.
Thanks

-- 

Marcel Barbosa Pinto
55 11 98255 8288

Re: Wicket.Ajax on static pages loading stateful components.

Posted by Marcel Barbosa Pinto <ma...@gmail.com>.
Hi Martin,

I am generating the static html in order to save out the database, as this
page has a lot of queries. But I am not sure if that was the right choice.

Maybe a better solution would be have this page rendered by wicket and
stored in Redis, so all the access to this page, would get its contents
from Redis, saving the database.
So this would prevent the same content to be rendered for every request.

I'll take a look at Stateless stuff, by the way.

Thanks for your help.

On Thu, Oct 15, 2015 at 4:30 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> You can try WicketStuff-Stateless project with its StatelessAjaxLink as
> quick solution.
>
> But your setup is rather strange. As far as I understand you want to keep
> the application stateless and that's why you do all this magic, right?
> I'd use stateless page served by Wicket on every request. No need to store
> it as static html, it will be fast enough.
> For the captcha I'd use some other solution, not Wicket-Extensions.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Oct 15, 2015 at 4:45 PM, Marcel Barbosa Pinto <
> marcel.power@gmail.com> wrote:
>
> > Hi guys,
> >
> > I am developing a heavy traffic web site entirely in Wicket 7 and I have
> > some questions about page caching.
> >
> > The approach I took was to generate the product page HTML from Wicket
> > statically saving these files to be served direct to the user as a Wicket
> > Resource.
> >
> > These pages has a Wicket contact form panel witch are dynamically loaded
> > using my own ajax that calls the mounted form panel from and manually
> > updates the HTML the the form panel generated markup.
> >
> > //pseudo code ^^
> >
> > //normal wicket form panel
> > mount("ad/contact")
> >
> > //static page page
> > mount("/ad/page{#id}", Resource("/static/produtc-details-{#id}.html"))
> >
> > This is working, but is not a good solution as I could only manage to get
> > the entire form html.
> > Inside the contact form I have a captcha that has an ajax link to refresh
> > its image.
> >
> > I would like to have a #formContainer at the static page then using the
> > Wicket.Ajax be able to refresh the container HTML (ad/contact) and when
> the
> > captcha needs the refresh, only the captcha has to be updated, so the
> user
> > doesn't loose the form text he could have inserted.
> >
> > It is possible to load the contact form from the static generated HTML
> > using the Wicket.Ajax and have the ajax component update working?
> >
> > If you guys have a better approach to this problem, please let me know.
> > Thanks
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288

Re: Wicket.Ajax on static pages loading stateful components.

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You can try WicketStuff-Stateless project with its StatelessAjaxLink as
quick solution.

But your setup is rather strange. As far as I understand you want to keep
the application stateless and that's why you do all this magic, right?
I'd use stateless page served by Wicket on every request. No need to store
it as static html, it will be fast enough.
For the captcha I'd use some other solution, not Wicket-Extensions.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 15, 2015 at 4:45 PM, Marcel Barbosa Pinto <
marcel.power@gmail.com> wrote:

> Hi guys,
>
> I am developing a heavy traffic web site entirely in Wicket 7 and I have
> some questions about page caching.
>
> The approach I took was to generate the product page HTML from Wicket
> statically saving these files to be served direct to the user as a Wicket
> Resource.
>
> These pages has a Wicket contact form panel witch are dynamically loaded
> using my own ajax that calls the mounted form panel from and manually
> updates the HTML the the form panel generated markup.
>
> //pseudo code ^^
>
> //normal wicket form panel
> mount("ad/contact")
>
> //static page page
> mount("/ad/page{#id}", Resource("/static/produtc-details-{#id}.html"))
>
> This is working, but is not a good solution as I could only manage to get
> the entire form html.
> Inside the contact form I have a captcha that has an ajax link to refresh
> its image.
>
> I would like to have a #formContainer at the static page then using the
> Wicket.Ajax be able to refresh the container HTML (ad/contact) and when the
> captcha needs the refresh, only the captcha has to be updated, so the user
> doesn't loose the form text he could have inserted.
>
> It is possible to load the contact form from the static generated HTML
> using the Wicket.Ajax and have the ajax component update working?
>
> If you guys have a better approach to this problem, please let me know.
> Thanks
>
> --
>
> Marcel Barbosa Pinto
> 55 11 98255 8288
>