org.apache.wicket.Request.getParameters()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.apache.wicket.Request.getParameters方法的一些代码示例,展示了Request.getParameters的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getParameters方法的具体详情如下:
包路径:org.apache.wicket.Request
类名称:Request
方法名:getParameters

Request.getParameters介绍

[英]Gets an array of multiple parameters by name.
[中]按名称获取多个参数的数组。

代码示例

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Gets the request parameters for this component as strings.
 * 
 * @return The values in the request for this component
 */
public String[] getInputAsArray()
{
  String[] values = getRequest().getParameters(getInputName());
  if (!isInputNullable())
  {
    if (values != null && values.length == 1 && values[0] == null)
    {
      // we the key got passed in (otherwise values would be null),
      // but the value was set to null.
      // As the servlet spec isn't clear on what to do with 'empty'
      // request values - most return an empty string, but some null -
      // we have to workaround here and deliberately set to an empty
      // string if the the component is not nullable (text components)
      return EMPTY_STRING_ARRAY;
    }
  }
  return values;
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Gets the request parameters for this component as strings.
 * 
 * @return The values in the request for this component
 */
public String[] getInputAsArray()
{
  String[] values = getRequest().getParameters(getInputName());
  if (!isInputNullable())
  {
    if (values != null && values.length == 1 && values[0] == null)
    {
      // we the key got passed in (otherwise values would be null),
      // but the value was set to null.
      // As the servlet spec isn't clear on what to do with 'empty'
      // request values - most return an empty string, but some null -
      // we have to workaround here and deliberately set to an empty
      // string if the the component is not nullable (text components)
      return EMPTY_STRING_ARRAY;
    }
  }
  return values;
}

代码示例来源:origin: org.wicketstuff/multi-text-input

public void updateModel() {
  super.updateModel();
  // do one more step by setting our model with the removed items
  // in case the user of the component needs this convenience
  String[] removed = getRequest().getParameters("removed_" + getInputName());
  MultiTextInputModel<Collection<T>> model = (MultiTextInputModel<Collection<T>>) this.getModel();
  model.setRemovedItems(convertInput(removed));
}

相关文章