Page would not be the right place (it was like that before btw), as the
page on which the listener is (e.g. a form or link) can differ from the
page that is rendered (e.g. when you use setResponsePage).
Eelco
Gili wrote:
I took a quick look at the cdapp RequestCycle. I am curious why
this is the correct place to inject such functionality as opposed to
on a per-Page object basis.
I mean, to my understanding, applying a application-wide
RequestCycle (rightfully-so) applies to all requests (static, dynamic,
etc). At least, that's my gut feeling.
Also keep in mind that what we called "static" under Wicket is
really not totally static. Wicket injects headers, translates URLs,
etc all under the hood. It is "mostly static".
What are your thoughts on this? Did I misunderstand something?
Thank you,
Gili
Eelco Hillenius wrote:
No, I am talking about RequestCycle here. That has nothing to do with
any component. The request cycle is created for every request, and
has onBeginRequest and onEndRequest called. If you look at the cdapp
example, it has a custom RequestCycle implementation that opens a
Hibernate session at the start of the request, and closes it at the
end. This works great, but I don't want it to happen for any static
resource. And as there is nothing you would want to do with static
resources that you can't using a filter, my proposal is to only call
these methods for 'dynamic'/ Wicket invocations.
Eelco
Gili wrote:
So are we saying that onBeginRequest(), onEndRequest() does not
belong in Component but rather in some subclass like Page?
I don't necessarily see the harm in leaving the current design
(where it is called regardless of the type of the underlying
Component). On the other hand, if you want to narrow the usage so it
only applies to Page, I think I am ok with that.
Gili
Eelco Hillenius wrote:
But the thing is, that it is also done for images etc. And if you
really want to trap all, just use a servlet filter (cause that's
what they're for anyway).
Eelco
Gili wrote:
I'm -1 on this. Regardless of whether the page is static or
dynamic, a request begins and ends. Who knows, developers might
make use of this for static pages in the future. A page-hit
counter comes to mind <shrug>
Gili
Eelco Hillenius wrote:
Currently, these onBeginRequest/onEndRequest are also called when
pages are static resources etc. I think this is wrong, as the
typical usage of these overridable methods (which are empty by
default) is to open/close Hibernate sessions etc.
Agreed to fix this?
Eelco
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop