public boolean hasFlowEvent() { return context.getRequestParameters().contains("_eventId"); }
/** * Obtain the user event from the current flow request. The default implementation returns the value of the request * parameter with name {@link #setEventIdParameterName(String) eventIdParameterName}. Subclasses may override. * @param context the current flow request context * @return the user event that occurred */ protected String determineEventId(RequestContext context) { return WebUtils.findParameterValue(context.getRequestParameters().asMap(), eventIdParameterName); }
protected String determineEventId(RequestContext context) { return WebUtils.findParameterValue(context.getRequestParameters().asMap(), "_eventId"); } }
public Event getFlowEvent() { return new Event(this, context.getRequestParameters().get("_eventId")); }
public Event getFlowEvent() { if (!hasFlowEvent()) { return null; } return new Event(this, getEventId(), requestContext.getRequestParameters().asAttributeMap()); }
/** * <p> * Causes the model to be populated from information contained in request parameters. * </p> * <p> * If a view has binding configuration then only model fields specified in the binding configuration will be * considered. In the absence of binding configuration all request parameters will be used to update matching fields * on the model. * </p> * * @param model the model to be updated * @return an instance of MappingResults with information about the results of the binding. */ protected MappingResults bind(Object model) { if (logger.isDebugEnabled()) { logger.debug("Binding to model"); } DefaultMapper mapper = new DefaultMapper(); ParameterMap requestParameters = requestContext.getRequestParameters(); if (binderConfiguration != null) { addModelBindings(mapper, requestParameters.asMap().keySet(), model); } else { addDefaultMappings(mapper, requestParameters.asMap().keySet(), model); } return mapper.map(requestParameters, model); }
/** * Bind allowed parameters in the external context request parameter map to the form object using given binder. * @param context the action execution context, for accessing and setting data in "flow scope" or "request scope" * @param binder the data binder to use * @throws Exception when an unrecoverable exception occurs */ protected void doBind(RequestContext context, DataBinder binder) throws Exception { if (logger.isDebugEnabled()) { logger.debug("Binding allowed request parameters in " + StylerUtils.style(context.getExternalContext().getRequestParameterMap()) + " to form object with name '" + binder.getObjectName() + "', pre-bind formObject toString = " + binder.getTarget()); if (binder.getAllowedFields() != null && binder.getAllowedFields().length > 0) { logger.debug("(Allowed fields are " + StylerUtils.style(binder.getAllowedFields()) + ")"); } else { logger.debug("(Any field is allowed)"); } } binder.bind(new MutablePropertyValues(context.getRequestParameters().asMap())); if (logger.isDebugEnabled()) { logger.debug("Binding completed for form object with name '" + binder.getObjectName() + "', post-bind formObject toString = " + binder.getTarget()); logger.debug("There are [" + binder.getBindingResult().getErrorCount() + "] errors, details: " + binder.getBindingResult().getAllErrors()); } }
/** * Checks if is renew present. * * @param context the context * @return true, if renew present */ protected final boolean isRenewPresent(final RequestContext context) { return StringUtils.hasText(context.getRequestParameters().get(CasProtocolConstants.PARAMETER_RENEW)); }
@Override public String selectLoginView(final RequestContext request) { if (request.getRequestParameters().contains(parameterName)) { final String key = request.getRequestParameters().get(parameterName); if (this.viewMappings.containsKey(key)) { return this.viewMappings.get(key); } } return defaultView; }
public static String getParamFromRequestParameters( final RequestContext context, final String attributeKey) { return context.getRequestParameters().get(attributeKey); }
/** * Obtain the user event from the current flow request. The default implementation returns the value of the request * parameter with name {@link #setEventIdParameterName(String) eventIdParameterName}. Subclasses may override. * @param context the current flow request context * @return the user event that occurred */ protected String determineEventId(RequestContext context) { return WebUtils.findParameterValue(context.getRequestParameters().asMap(), eventIdParameterName); }
/** * Obtain the user event from the current flow request. The default implementation returns the value of the request * parameter with name {@link #setEventIdParameterName(String) eventIdParameterName}. Subclasses may override. * @param context the current flow request context * @return the user event that occurred */ protected String determineEventId(RequestContext context) { return WebUtils.findParameterValue(context.getRequestParameters().asMap(), eventIdParameterName); }
protected String determineEventId(RequestContext context) { return WebUtils.findParameterValue(context.getRequestParameters().asMap(), "_eventId"); } }
public Event getFlowEvent() { return new Event(this, context.getRequestParameters().get("_eventId")); }
private void determineEventId(RequestContext context) { eventId = WebUtils.findParameterValue(context.getRequestParameters().asMap(), "_eventId"); } }
private MappingResults bind(Object model) { if (logger.isDebugEnabled()) { logger.debug("Binding to model"); } DefaultMapper mapper = new DefaultMapper(); ParameterMap requestParameters = requestContext.getRequestParameters(); if (binderConfiguration != null) { addModelBindings(mapper, requestParameters.asMap().keySet(), model); } else { addDefaultMappings(mapper, requestParameters.asMap().keySet(), model); } return mapper.map(requestParameters, model); }
public Event getFlowEvent() { if (!hasFlowEvent()) { return null; } return new Event(this, eventId, requestContext.getRequestParameters().asAttributeMap()); }
public Event getFlowEvent() { if (!hasFlowEvent()) { return null; } return new Event(this, getEventId(), requestContext.getRequestParameters().asAttributeMap()); }
protected void setUp() throws Exception { configureJsf(); this.extContext.setNativeContext(this.servletContext); this.extContext.setNativeRequest(this.request); this.extContext.setNativeResponse(this.response); RequestContextHolder.setRequestContext(this.context); EasyMock.expect(this.context.getFlashScope()).andStubReturn(this.flashMap); EasyMock.expect(this.context.getExternalContext()).andStubReturn(this.extContext); EasyMock.expect(this.context.getRequestParameters()).andStubReturn( new LocalParameterMap(new HashMap<>())); }
public final void testUserEventQueued_GETRefresh() { MockParameterMap requestParameterMap = new MockParameterMap(); requestParameterMap.put("execution", "e1s1"); EasyMock.expect(this.context.getRequestParameters()).andStubReturn(requestParameterMap); EasyMock.replay(this.context, this.flowExecutionContext, this.flowMap, this.flashScope); JsfView createdView = new JsfView(new UIViewRoot(), this.jsfMock.lifecycle(), this.context); assertFalse("No user event should be queued", createdView.userEventQueued()); }