List of usage examples for org.apache.wicket.request Url setQueryParameter
public void setQueryParameter(final String name, final Object value)
From source file:com.github.javawithmarcus.wicket.cdi.ConversationPropagator.java
License:Apache License
@Override public void onUrlMapped(RequestCycle cycle, IRequestHandler handler, Url url) { Conversation conversation = getConversation(); logger.debug("In onUrlMapped id = {}", conversation.getId()); // no need to propagate the conversation to packaged resources, they should never change if (handler instanceof ResourceReferenceRequestHandler) { if (((ResourceReferenceRequestHandler) handler) .getResourceReference() instanceof PackageResourceReference) { return; }//from ww w .j a v a 2 s. c om } if (conversation.isTransient()) { return; } if (getPropagation().propagatesViaParameters(handler)) { // propagate cid to bookmarkable pages via urls logger.debug("Propagating non-transient conversation {} via url", conversation.getId()); url.setQueryParameter(CID_ATTR, conversation.getId()); } else { //we did not propagate. //Cancel scheduled conversation end if page is auto. Page page = getPage(handler); if (page != null) { Conversational annotation = page.getClass().getAnnotation(Conversational.class); if (annotation != null) { if (annotation.auto() && getConversationManager().isConversationScheduledForEnd()) { getConversationManager().cancelConversationEnd(); //was scheduled to end but next page is auto } } } } }