日期:2014-05-19  浏览次数:20600 次

SSH中jsp页面对象.参数名传参到后台无法获取值,求分析,求讲解
首先通过菜单进入一个list页面,action方法如下:
Java code

private NewInsuranceMarketTaskService newInsuranceMarketTaskService;
private NewInsuranceMarketTask newInsuranceMarketTask;//实体Bean对象
private List<NewInsuranceMarketTask> newInsuranceMarketTaskList;//获取List
public String list(){
        try{
            System.out.println("// Debug Enter list :");
            // init QueryBean
            currentUser = super.getSysUser();
            newInsuranceMarketTaskQuery = new NewInsuranceMarketTaskQuery();
                        int firstRecord = 0;
            if (page == null) {
                page = new Page();
            }
            newInsuranceMarketTaskList = newInsuranceMarketTaskService.queryMarketTaskByQuery(newInsuranceMarketTaskQuery,currentUser, firstRecord, page.getPageSize());
            return "list";
        }catch (Exception e) {
            log.error(e.getMessage(), e);
            return ERROR;
        }

    }
public NewInsuranceMarketTaskService getNewInsuranceMarketTaskService() {
        return newInsuranceMarketTaskService;
    }
    @Resource
    public void setNewInsuranceMarketTaskService(NewInsuranceMarketTaskService newInsuranceMarketTaskService) {
        this.newInsuranceMarketTaskService = newInsuranceMarketTaskService;
    }
    public NewInsuranceMarketTask getNewInsuranceMarketTask() {
        return newInsuranceMarketTask;
    }
    public void setNewInsuranceMarketTask(NewInsuranceMarketTask newInsuranceMarketTask) {
        this.newInsuranceMarketTask = newInsuranceMarketTask;
    }
public List<NewInsuranceMarketTask> getNewInsuranceMarketTaskList() {
        return newInsuranceMarketTaskList;
    }
    public void setNewInsuranceMarketTaskList(
            List<NewInsuranceMarketTask> newInsuranceMarketTaskList) {
        this.newInsuranceMarketTaskList = newInsuranceMarketTaskList;
    }


jsp页面布局如下
XML code

<s:if test="%{newInsuranceMarketTaskList != null && newInsuranceMarketTaskList.size()>0}">
                   <s:iterator value="newInsuranceMarketTaskList" id="newInsuranceMarketTask" status="index">
                    <tr>
                        <td align="center">
                            <input type="checkbox"  value='<s:property value="#newInsuranceMarketTask.id"/>' name="checkbox" id="<s:property value='#newInsuranceMarketTask.subStatus.id'/>" >
                        </td>
                        <td align="center">
              <a href="infoNewInsuranceMarketTask.action?newInsuranceMarketTask.id=<s:property value='id'/>" style="cursor:pointer;" target="_blank" title="点击查看详情">
                            <s:property value="#newInsuranceMarketTask.id"/>
                        </a>
                        </td>
                        <td align="center">
                        &nbsp;<s:if test="#newInsuranceMarketTask.taskType==1">个人</s:if><s:if test="#newInsuranceMarketTask.taskType==2">单位</s:if>
                        </td>
                        <td align="center">&nbsp;
                            <s:property value="#newInsuranceMarketTask.newInsuranceType.name"/>
                        </td></tr>
                   </s:iterator>
               </s:if>

在jsp页面中超链接进入明细查看页面<a href="infoNewInsuranceMarketTask.action?newInsuranceMarket