I've got a case where I want to abort request processing and redirect
before my session is constructed (since it's fairly expensive).  I can
trigger the abort and redirect via my RequestCycle.onBeginRequest() impl
by throwing a RedirectToUrlException.  However, the abort processing in
RequestCycle invokes getSession():

 

// wicket-2013: create a new session if invalidated

if (getSession().isSessionInvalidated())

 

which of course triggers session creation if it doesn't already exist.
This is 1.4.14.  It appears 2013 added this check so that the session
would no longer be available in the current thread - but it seems at a
pretty high side-effect cost.

 

I could add some thread local error flag to deal with this case but
that's pretty ugly.  Is there some better way to stop session creation
in this scenario?

 

Thanks -

 

Tom Palmer

Director, Strategic Technology Services

AT&T Hosting & Application Services | 2000 Perimeter Park Drive, Suite
140 | Morrisville, NC 27560

Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431

[email protected] <mailto:[email protected]>  

 

Confidentiality Notice and Disclaimer: This e-mail transmission may
contain confidential and/or proprietary information of AT&T that is
intended only for the individual or entity named in the e-mail address.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution, or reliance upon the contents of this
e-mail is strictly prohibited. If you have received this e-mail
transmission in error, please reply to the sender, so that AT&T can
arrange for proper delivery, and then please delete the message from
your inbox. Thank you. 

 

Reply via email to