本文整理匯總了Java中org.springframework.web.util.WebUtils.getParametersStartingWith方法的典型用法代碼示例。如果您正苦於以下問題:Java WebUtils.getParametersStartingWith方法的具體用法?Java WebUtils.getParametersStartingWith怎麽用?Java WebUtils.getParametersStartingWith使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.util.WebUtils
的用法示例。
在下文中一共展示了WebUtils.getParametersStartingWith方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRequestParams
import org.springframework.web.util.WebUtils; //導入方法依賴的package包/類
/**
* 返回請求參數
*
* @param request
* @return
*/
private String getRequestParams(HttpServletRequest request) {
Map<String, Object> parameterMap = new HashMap<>();
// http request中的參數
Map<String, Object> requestparameterMap = WebUtils.getParametersStartingWith(request, "");
parameterMap.putAll(requestparameterMap);
return JSON.toJSONString(parameterMap);
}
示例2: ajaxBuildSaveOption
import org.springframework.web.util.WebUtils; //導入方法依賴的package包/類
private Question ajaxBuildSaveOption(HttpServletRequest request) throws UnsupportedEncodingException {
String quId=request.getParameter("quId");
String belongId=request.getParameter("belongId");
String quTitle=request.getParameter("quTitle");
String orderById=request.getParameter("orderById");
String tag=request.getParameter("tag");
//isRequired 是否必選
String isRequired=request.getParameter("isRequired");
/** 某一類型題目特有的 **/
//hv 1水平顯示 2垂直顯示
String hv=request.getParameter("hv");
//randOrder 選項隨機排列
String randOrder=request.getParameter("randOrder");
String cellCount=request.getParameter("cellCount");
if("".equals(quId)){
quId=null;
}
Question entity=questionManager.getModel(quId);
entity.setBelongId(belongId);
if(quTitle!=null){
quTitle=URLDecoder.decode(quTitle,"utf-8");
entity.setQuTitle(quTitle);
}
entity.setOrderById(Integer.parseInt(orderById));
entity.setTag(Integer.parseInt(tag));
entity.setQuType(QuType.PARAGRAPH);
//參數
isRequired=(isRequired==null || "".equals(isRequired))?"0":isRequired;
hv=(hv==null || "".equals(hv))?"0":hv;
randOrder=(randOrder==null || "".equals(randOrder))?"0":randOrder;
cellCount=(cellCount==null || "".equals(cellCount))?"0":cellCount;
entity.setIsRequired(Integer.parseInt(isRequired));
entity.setHv(Integer.parseInt(hv));
entity.setRandOrder(Integer.parseInt(randOrder));
entity.setCellCount(Integer.parseInt(cellCount));
//邏輯選項設置
Map<String, Object> quLogicIdMap=WebUtils.getParametersStartingWith(request, "quLogicId_");
List<QuestionLogic> quLogics=new ArrayList<QuestionLogic>();
for (String key : quLogicIdMap.keySet()) {
String cgQuItemId=request.getParameter("cgQuItemId_"+key);
String skQuId=request.getParameter("skQuId_"+key);
String visibility=request.getParameter("visibility_"+key);
String logicType=request.getParameter("logicType_"+key);
Object quLogicId=quLogicIdMap.get(key);
String quLogicIdValue=(quLogicId!=null)?quLogicId.toString():"";
QuestionLogic quLogic=new QuestionLogic();
if("".equals(quLogic)){
quLogic=null;
}
quLogic.setId(quLogicIdValue);
quLogic.setCgQuItemId(cgQuItemId);
quLogic.setSkQuId(skQuId);
quLogic.setVisibility(Integer.parseInt(visibility));
quLogic.setTitle(key);
quLogic.setLogicType(logicType);
quLogics.add(quLogic);
}
entity.setQuestionLogics(quLogics);
return entity;
}
示例3: ajaxBuildSaveOption
import org.springframework.web.util.WebUtils; //導入方法依賴的package包/類
private Question ajaxBuildSaveOption(HttpServletRequest request) throws UnsupportedEncodingException {
String quId=request.getParameter("quId");
String belongId=request.getParameter("belongId");
String quTitle=request.getParameter("quTitle");
String orderById=request.getParameter("orderById");
String tag=request.getParameter("tag");
//isRequired 是否必選
String isRequired=request.getParameter("isRequired");
/** 某一類型題目特有的 **/
//hv 1水平顯示 2垂直顯示
String hv=request.getParameter("hv");
//randOrder 選項隨機排列
String randOrder=request.getParameter("randOrder");
String cellCount=request.getParameter("cellCount");
if("".equals(quId)){
quId=null;
}
Question entity=questionManager.getModel(quId);
entity.setBelongId(belongId);
if(quTitle!=null){
quTitle=URLDecoder.decode(quTitle,"utf-8");
entity.setQuTitle(quTitle);
}
entity.setOrderById(Integer.parseInt(orderById));
entity.setTag(Integer.parseInt(tag));
entity.setQuType(QuType.PAGETAG);
//參數
isRequired=(isRequired==null || "".equals(isRequired))?"0":isRequired;
hv=(hv==null || "".equals(hv))?"0":hv;
randOrder=(randOrder==null || "".equals(randOrder))?"0":randOrder;
cellCount=(cellCount==null || "".equals(cellCount))?"0":cellCount;
entity.setIsRequired(Integer.parseInt(isRequired));
entity.setHv(Integer.parseInt(hv));
entity.setRandOrder(Integer.parseInt(randOrder));
entity.setCellCount(Integer.parseInt(cellCount));
//邏輯選項設置
Map<String, Object> quLogicIdMap=WebUtils.getParametersStartingWith(request, "quLogicId_");
List<QuestionLogic> quLogics=new ArrayList<QuestionLogic>();
for (String key : quLogicIdMap.keySet()) {
String cgQuItemId=request.getParameter("cgQuItemId_"+key);
String skQuId=request.getParameter("skQuId_"+key);
String visibility=request.getParameter("visibility_"+key);
String logicType=request.getParameter("logicType_"+key);
Object quLogicId=quLogicIdMap.get(key);
String quLogicIdValue=(quLogicId!=null)?quLogicId.toString():"";
QuestionLogic quLogic=new QuestionLogic();
if("".equals(quLogic)){
quLogic=null;
}
quLogic.setId(quLogicIdValue);
quLogic.setCgQuItemId(cgQuItemId);
quLogic.setSkQuId(skQuId);
quLogic.setVisibility(Integer.parseInt(visibility));
quLogic.setTitle(key);
quLogic.setLogicType(logicType);
quLogics.add(quLogic);
}
entity.setQuestionLogics(quLogics);
return entity;
}
示例4: getParameterMap
import org.springframework.web.util.WebUtils; //導入方法依賴的package包/類
/**
* 獲得參數Map
*
* @param request
* @return
*/
public static final Map<String, Object> getParameterMap(HttpServletRequest request) {
return WebUtils.getParametersStartingWith(request, null);
}
示例5: ServletRequestParameterPropertyValues
import org.springframework.web.util.WebUtils; //導入方法依賴的package包/類
/**
* Create new ServletRequestPropertyValues supplying both prefix and
* prefix separator.
* @param request HTTP request
* @param prefix the prefix for parameters (the full prefix will
* consist of this plus the separator)
* @param prefixSeparator separator delimiting prefix (e.g. "spring")
* and the rest of the parameter name ("param1", "param2")
*/
public ServletRequestParameterPropertyValues(ServletRequest request, String prefix, String prefixSeparator) {
super(WebUtils.getParametersStartingWith(
request, (prefix != null ? prefix + prefixSeparator : null)));
}
示例6: getParameterMap
import org.springframework.web.util.WebUtils; //導入方法依賴的package包/類
/**
* 獲得參數Map
*
* @param request
* @return
*/
public static Map<String, Object> getParameterMap(HttpServletRequest request) {
return WebUtils.getParametersStartingWith(request, null);
}