Exemple #1
0
 @SuppressWarnings("unchecked")
 protected void setBlockParametersForRender(State state, Parameters blockParameters) {
   ServletRequest request = state.getRequest();
   String prefix = getPrefix(state);
   log.debug("prefix " + prefix);
   blockParameters.setAutoCasting(true);
   for (Map.Entry<String, String[]> entry :
       ((Map<String, String[]>) request.getParameterMap()).entrySet()) {
     String key = entry.getKey();
     if (key.startsWith(prefix)) {
       log.trace("setting" + entry);
       blockParameters.setIfDefined(key.substring(prefix.length()), entry.getValue());
     }
   }
   if (log.isDebugEnabled()) {
     log.debug("Set " + blockParameters);
   }
 }
Exemple #2
0
 /** @todo */
 protected void setBlockParametersForProcess(State state, Parameters blockParameters) {
   ServletRequest request = state.getRequest();
   for (Map.Entry<String, ?> entry : blockParameters.toMap().entrySet()) {
     request.setAttribute(entry.getKey(), entry.getValue());
   }
 }