关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 9627|回复: 6

[Online开发] 自定义页面和Controller类,获取页面组件值报错问题

[复制链接]
发表于 2017-10-10 17:54:51 | 显示全部楼层 |阅读模式
自定义了一个页面和Controller类,在后台Controller类使用request.getParameter("")获取页面组件值时页面报错。
请问,这种情况如何不用实体类,直接获取页面组件的值?

自定义页面主要代码:
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>
<script type="text/javascript">
function cancelLib(){
  document.ff.action = "djxqAdjustController.do?doCancel";
  document.getElementById("ff").submit();
}
function saveLib(){
  document.ff.action = "djxqAdjustController.do?doSave";
  document.getElementById("ff").submit();
}
</script>
    <div title="抽签内容指定" style="height:350px;" name="editPanel" id="editPanel" fit="true" class="easyui-panel">   
  <t:formvalid formid="ff" dialog="true" layout="table" tiptype="4" action="djxqAdjustController.do?doSave">
   <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
    <thead>
     <tr><th>库类型</th><th>指定企业编号</th></tr>
    </thead>
    <tbody>
     <tr>
      <td class="value" align="center">      
        造价咨询库
      </td>
      <td class="value">
       <input  id="djxq_cost_lib" name="djxq_cost_lib"  placeholder="点击选择企业" type="text" style="cursor: pointer;" class="inputxt" value="">      
      </td>
     </tr>     <tr>
      <td class="value" align="center">      
       <button type="button" id="but_cancel" class="width-35">
                            <span class="bigger-110" >取消</span>
                         </button>
      </td>
      <td class="value">
       <button type="button" id="but_save" class="width-35">
                            <span class="bigger-110" >保存</span>
                         </button>      
      </td>
     </tr>
    </tbody>
   </table>
  </t:formvalid>
  
    </div>

file:///
Controller类主要代码:
package com.jeecg.adjust.controller;
@Controller
@RequestMapping("/djxqAdjustController")
public class DjxqAdjustController extends BaseController {
private static final Logger logger = Logger.getLogger(JeecgFormDemoController.class);

@Autowired
private SystemService systemService;
@Autowired
private DjxqCostLibServiceI djxqCostLibService;

@RequestMapping(params = "djxqAdjustAdd")
public ModelAndView djxqAdjustAdd(HttpServletRequest request) {
  logger.info("djxqAdjustAdd");
  //return new ModelAndView("com/jeecg/demo/form_popupMultiValue");
  return new ModelAndView("com/jeecg/adjust/djxqAdjust-add");
}

@RequestMapping(params = "doSave")
@ResponseBody
public AjaxJson doSave(HttpServletRequest request) {
  String message = null;
  AjaxJson j = new AjaxJson();
  message = "保存指定企业信息成功";
  try{
   String djxq_cost_lib = request.getParameter("djxq_cost_lib");//造价咨询库
   System.out.println("djxq_cost_lib = "+ djxq_cost_lib);   
  }catch(Exception e){
   e.printStackTrace();
   message = "保存指定企业信息失败";
   throw new BusinessException(e.getMessage());
  }
  j.setMsg(message);
  return j;
}

@RequestMapping(params = "doCancel")
@ResponseBody
public AjaxJson doCancel(HttpServletRequest request) {
  String message = null;
  AjaxJson j = new AjaxJson();
  message = "取消指定企业信息成功";
  try{
  }catch(Exception e){
   e.printStackTrace();
   message = "取消指定企业信息失败";
   throw new BusinessException(e.getMessage());
  }
  j.setMsg(message);
  return j;
}
}

错误信息:
Parameter conditions "djxqAdjustAdd" not met for actual request parameters: doSave={}, djxq_cost_lib={3, 3}, djxq_est_lib={1, 1}, djxq_acc_lib={1, 1}, djxq_cap_lib={}, djxq_land_lib={}
错误信息:
org.springframework.web.bind.UnsatisfiedServletRequestParameterException: Parameter conditions "djxqAdjustAdd" not met for actual request parameters: doSave={}, djxq_cost_lib={3, 3}, djxq_est_lib={1, 1}, djxq_acc_lib={1, 1}, djxq_cap_lib={}, djxq_land_lib={}
 楼主| 发表于 2017-10-10 19:28:28 | 显示全部楼层
jeecg版本为3.7.1
 <t:formvalid>跟Controller类如何能不通过实体类,通过简单的方式传递页面组件的值?
自己顶顶,希望大神帮忙给解答一下,或给个参考的例子,谢谢!
 楼主| 发表于 2017-10-11 11:00:25 | 显示全部楼层
自己顶顶,希望大神帮忙给解答一下,或给个参考的例子,谢谢!
 楼主| 发表于 2017-10-11 13:43:49 | 显示全部楼层
自己顶顶,希望大神帮忙给解答一下,或给个参考的例子,谢谢!
发表于 2017-10-11 15:31:32 | 显示全部楼层
jeecg默认的表单功能都是现成的,你为什么要自己实现提交?
 楼主| 发表于 2017-10-11 16:34:45 | 显示全部楼层
我要实现的这个功能不需要对应的实体类,值的修改不存储在数据库中。数据结构想用多个字符串或Map,不是实体类。
发表于 2017-10-12 19:20:05 | 显示全部楼层
那就别用<t:formvalid 标签,自己实现form
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表