1) I want to generate a url for a wicket page without a request cycle.
I can access the web application, but no request is active (think
about a mail notification from a headless scheduled service containing
a wicket link). I don't want to hardwire the link in the code, I would
like to refer to the class + pageparameters (so the url generation
still works, even if the url encoding strategy changes). Is there any
way to get such a url outside of a wicket component / request cycle?
What do you want to do with that url?
I guess you want to generate a bookmarkable url ?
The problem is that you really need a request cycle. Because that is used for all kinds of stuff
So can;t you just mockup one?
2) I have my custom WebRequestCycle for spanning a transaction around
every wicket request, rolling it back on errors, comitting it at the
end of the request. Problem: in the onEndRequest method there is quite
a chance that an (technical) error occurs (database exception while
committing). I want to forward to an error page in these cases.
setResponsePage doesn't do anything at that point, redirectTo can fail
if it's a redirect already. Any chance to safely go to an error page
at that point in the request cycle? Or another way to implement such a
request-specific strategy with correct error handling? (I could omit
the transaction around every web request, because I have them around
my service methods anyway, but I like that strategy because if
something goes wrong somewhere, I like to roll back the whole
request's transaction just to be sure)
No this is not possible. In onEndRequest of request cycle you can't serve another
page again. Because everying is already committed to response of the web request.
(like redirect url)
If you want this kind of behaviour you can do it in a common base page and then
in the method onAfterRender() of the page.
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list Wicketemail@example.com https://lists.sourceforge.net/lists/listinfo/wicket-user