本文整理汇总了Java中org.springframework.web.util.WebUtils.findParameterValue方法的典型用法代码示例。如果您正苦于以下问题:Java WebUtils.findParameterValue方法的具体用法?Java WebUtils.findParameterValue怎么用?Java WebUtils.findParameterValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.util.WebUtils
的用法示例。
在下文中一共展示了WebUtils.findParameterValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUserMap
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
* 获取用户列表()
*
* @return
* @throws IOException
*/
@RequestMapping(value = "/map", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> getUserMap(HttpServletRequest request, HttpServletResponse response) {
String sPage = WebUtils.findParameterValue(request, "page");
String sPageSize = request.getParameter("pageSize");
int page = Integer.parseInt(sPage);
int pageSize = Integer.parseInt(sPageSize);
Map<String, Object> map = new HashMap<String, Object>();
List<User> userList = userService.getUserList(page, pageSize);
map.put("userList", userList);
return map;
}
示例2: getUserList
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
* 获取用户列表
*
* @return
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public List<User> getUserList(HttpServletRequest request,HttpServletResponse response) {
String sPage = WebUtils.findParameterValue(request, "page");
String sPageSize = request.getParameter("pageSize");
int page = Integer.parseInt(sPage);
int pageSize = Integer.parseInt(sPageSize);
List<User> userList = userService.getUserList(page, pageSize);
return userList;
}
示例3: addUserBean
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
* 添加用户
*
* @return
*/
@ResponseBody
@RequestMapping(value = "/add", method = RequestMethod.PUT)
public List<User> addUserBean(@RequestBody User user, HttpServletRequest request,
HttpServletResponse response) {
String sPage = WebUtils.findParameterValue(request, "page");
String sPageSize = request.getParameter("pageSize");
int page = Integer.parseInt(sPage);
int pageSize = Integer.parseInt(sPageSize);
userService.saveOrUpdateUser(user);
List<User> userList = userService.getUserList(page, pageSize);
return userList;
}
示例4: updateUser
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
* 更新用户
*
* @param user
* 前台获取用户对象
* @param request
* 请求对象
* @return
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public List<User> updateUser(@RequestBody User user, HttpServletRequest request,
HttpServletResponse response) {
String sPage = WebUtils.findParameterValue(request, "page");
String sPageSize = request.getParameter("pageSize");
int page = Integer.parseInt(sPage);
int pageSize = Integer.parseInt(sPageSize);
userService.saveOrUpdateUser(user);
List<User> list = userService.getUserList(page, pageSize);
return list;
}
示例5: deleteUser
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
* 删除用户
*
* @param request
* 请求对象
* @return
*/
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@ResponseBody
public List<User> deleteUser(HttpServletRequest request,
HttpServletResponse response) {
String userId = request.getParameter("id");
String sPage = WebUtils.findParameterValue(request, "page");
String sPageSize = request.getParameter("pageSize");
int page = Integer.parseInt(sPage);
int pageSize = Integer.parseInt(sPageSize);
User user = new User(userId);
userService.deleteUser(user);
List<User> list = userService.getUserList(page, pageSize);
return list;
}
示例6: createConfig
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
@ResponseBody
@RequestMapping(value = "/create", method = RequestMethod.PUT)
public List<EmbedConfig> createConfig(@RequestBody EmbedConfig config, HttpServletRequest request) {
String sPage = WebUtils.findParameterValue(request, "page");
String sPageSize = request.getParameter("pageSize");
int page = Integer.parseInt(sPage);
int pageSize = Integer.parseInt(sPageSize);
configService.save(config);
return configService.getConfigList(page, pageSize);
}
示例7: PaginationSupport
import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
*
* 处理参数传递的问题
* for jquery easyui datagrid
* @author chen ze
* @param request
*/
public PaginationSupport(HttpServletRequest request) {
String pageNo = WebUtils.findParameterValue(request, "page");
String pageSize = WebUtils.findParameterValue(request, "rows");
this.pageNumber=(pageNo == null ? 1 : Integer.parseInt(pageNo));
this.pageSize=(pageSize == null ? DEFAULT_PAGE_SIZE : Integer.parseInt(pageSize));
}